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

@ -1501,10 +1501,10 @@ class Contact
{
if (!empty($contact)) {
$contact = self::checkAvatarCacheByArray($contact, $no_update);
if (!empty($contact[$field])) {
return $contact[$field];
} elseif (!empty($contact['id'])) {
if (!empty($contact['id'])) {
return self::getAvatarUrlForId($contact['id'], $size, $contact['updated'] ?? '');
} elseif (!empty($contact[$field])) {
return $contact[$field];
} elseif (!empty($contact['avatar'])) {
$avatar = $contact['avatar'];
}
@ -1713,7 +1713,7 @@ class Contact
$condition = ["`nurl` = ? AND ((`uid` = ? AND `network` IN (?, ?)) OR `uid` = ?)",
Strings::normaliseLink($url), $uid, Protocol::FEED, Protocol::MAIL, 0];
$contact = self::selectFirst(['id', 'updated'], $condition);
return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated']);
return self::getAvatarUrlForId($contact['id'] ?? 0, $size, $contact['updated'] ?? '');
}
/**