Fetch avatar by id

This commit is contained in:
Michael 2022-04-29 07:30:13 +00:00
parent 1326239576
commit d44641e58c
7 changed files with 45 additions and 9 deletions

View file

@ -659,6 +659,16 @@ class Conversation
$pinned = '';
}
if (in_array($item['network'], [Protocol::FEED, Protocol::MAIL])) {
$owner_avatar = $author_avatar = $item['contact-id'];
$owner_updated = $author_updated = '';
} else {
$owner_avatar = $item['owner-id'];
$owner_updated = $item['owner-updated'];
$author_avatar = $item['author-id'];
$author_updated = $item['author-updated'];
}
$tmp_item = [
'template' => $tpl,
'id' => ($preview ? 'P0' : $item['id']),
@ -676,7 +686,7 @@ class Conversation
'name' => $profile_name,
'sparkle' => $sparkle,
'lock' => false,
'thumb' => $this->baseURL->remove(Contact::getAvatarUrlForUrl($item['author-link'], $item['uid'], Proxy::SIZE_THUMB)),
'thumb' => $this->baseURL->remove(Contact::getAvatarUrlForId($author_avatar, Proxy::SIZE_THUMB, $author_updated)),
'title' => $title,
'body_html' => $body_html,
'tags' => $tags['tags'],
@ -697,7 +707,7 @@ class Conversation
'indent' => '',
'owner_name' => '',
'owner_url' => '',
'owner_photo' => $this->baseURL->remove(Contact::getAvatarUrlForUrl($item['owner-link'], $item['uid'], Proxy::SIZE_THUMB)),
'owner_photo' => $this->baseURL->remove(Contact::getAvatarUrlForId($owner_avatar, Proxy::SIZE_THUMB, $owner_updated)),
'plink' => ItemModel::getPlink($item),
'edpost' => false,
'pinned' => $pinned,