Fix local avatar, improve speed for fetching cached photos

This commit is contained in:
Michael 2022-05-10 18:18:24 +00:00
parent 776ce3f63a
commit fae414fedd
5 changed files with 54 additions and 49 deletions

View file

@ -304,10 +304,12 @@ class Photo extends BaseModule
$photo = MPhoto::selectFirst([], ['resource-id' => $resourceid], ['order' => ['scale']]);
if (!empty($photo)) {
return $photo;
} else {
$url = $contact['avatar'];
}
} else {
$url = $contact['photo'];
}
// We continue with the avatar link when the photo link is invalid
$url = $contact['avatar'];
} elseif (!empty($contact['avatar'])) {
$url = $contact['avatar'];
}
@ -340,6 +342,7 @@ class Photo extends BaseModule
}
}
if (empty($mimetext)) {
Logger::info('Blubb');
if ($customsize <= Proxy::PIXEL_MICRO) {
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_MICRO);
} elseif ($customsize <= Proxy::PIXEL_THUMB) {