mirror of
https://github.com/friendica/friendica
synced 2025-04-23 21:50:10 +00:00
Unified avatar paths
This commit is contained in:
parent
9edc75e29d
commit
19aef93560
7 changed files with 24 additions and 18 deletions
|
@ -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'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue