use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Item as ItemModel;
+use Friendica\Model\Photo;
use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Model\User;
$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']),
'name' => $profile_name,
'sparkle' => $sparkle,
'lock' => false,
- 'thumb' => $this->baseURL->remove(Contact::getAvatarUrlForId($author_avatar, Proxy::SIZE_THUMB, $author_updated)),
+ 'thumb' => $this->baseURL->remove($this->item->getAuthorAvatar($item)),
'title' => $title,
'body_html' => $body_html,
'tags' => $tags['tags'],
'indent' => '',
'owner_name' => '',
'owner_url' => '',
- 'owner_photo' => $this->baseURL->remove(Contact::getAvatarUrlForId($owner_avatar, Proxy::SIZE_THUMB, $owner_updated)),
+ 'owner_photo' => $this->baseURL->remove($this->item->getOwnerAvatar($item)),
'plink' => ItemModel::getPlink($item),
'edpost' => false,
'pinned' => $pinned,
$condition = DBA::mergeConditions($condition,
["`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)", $uid, Verb::getID(Activity::FOLLOW)]);
- $params = ['order' => ['uri-id' => false, 'uid' => true]];
- $thread_parents = Post::select(['uri-id', 'causer-id'], $condition, $params);
+ $thread_parents = Post::select(['uri-id', 'causer-id'], $condition, ['order' => ['uri-id' => false, 'uid']]);
$thr_parent = [];