Removal of duplicated photo entries for a contact

This commit is contained in:
Michael 2021-07-04 10:40:03 +00:00
parent 3780e51806
commit 47904f99c2
2 changed files with 28 additions and 3 deletions

View file

@ -214,7 +214,7 @@ class Photo extends BaseModule
If (($contact['uid'] != 0) && empty($contact['photo']) && empty($contact['avatar'])) {
$contact = Contact::getByURL($contact['url'], false, ['avatar', 'photo', 'xmpp', 'addr']);
}
if (!empty($contact['photo'])) {
if (!empty($contact['photo']) && !empty($contact['avatar'])) {
// Fetch photo directly
$resourceid = MPhoto::ridFromURI($contact['photo']);
if (!empty($resourceid)) {
@ -223,7 +223,8 @@ class Photo extends BaseModule
return $photo;
}
}
$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'];
} elseif ($customsize <= Proxy::PIXEL_MICRO) {