forked from GNUsocial/gnu-social
Use gravatar as a fallback for missing files
This commit is contained in:
parent
c7a4aaddfc
commit
52493a9a2b
@ -32,7 +32,8 @@ class GravatarPlugin extends Plugin
|
||||
{
|
||||
function onEndProfileGetAvatar($profile, $size, &$avatar)
|
||||
{
|
||||
if (empty($avatar)) {
|
||||
if (empty($avatar) ||
|
||||
(!empty($avatar->filename) && !file_exists(Avatar::path($avatar->filename)))) {
|
||||
$user = $profile->getUser();
|
||||
if (!empty($user) && !empty($user->email)) {
|
||||
// Fake one!
|
||||
|
Loading…
Reference in New Issue
Block a user