Unified avatar paths

This commit is contained in:
Michael 2021-06-29 20:26:58 +00:00
parent 9edc75e29d
commit 19aef93560
7 changed files with 24 additions and 18 deletions

View file

@ -191,6 +191,14 @@ class Photo extends BaseModule
$contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']);
}
if (!empty($contact['photo'])) {
// Fetch photo directly
$resourceid = MPhoto::ridFromURI($contact['photo']);
if (!empty($resourceid)) {
$photo = MPhoto::selectFirst([], ['resource-id' => $resourceid], ['order' => ['scale']]);
if (!empty($photo)) {
return $photo;
}
}
$url = $contact['photo'];
} elseif (!empty($contact['avatar'])) {
$url = $contact['avatar'];