From 71b6226909aaef47ae4cfa7ba3d880cb0a73e2ef Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 28 Jul 2020 19:30:55 +0000 Subject: [PATCH] Some more avatar function replacements --- include/conversation.php | 5 ++--- mod/message.php | 21 ++++++------------- mod/network.php | 2 +- mod/ping.php | 2 +- mod/suggest.php | 3 +-- src/Content/ForumManager.php | 5 ++--- src/Content/Text/HTML.php | 3 +-- src/Content/Widget.php | 6 +++--- src/Content/Widget/ContactBlock.php | 2 +- src/Factory/Notification/Notification.php | 14 ++++++------- src/Module/BaseSearch.php | 6 +++--- src/Module/Contact.php | 3 +-- src/Module/Search/Acl.php | 25 +++++++++++------------ src/Object/Post.php | 5 ++--- view/theme/vier/theme.php | 8 ++++---- 15 files changed, 47 insertions(+), 63 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 8050296a5..86af3b69d 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -40,7 +40,6 @@ use Friendica\Object\Thread; use Friendica\Protocol\Activity; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\Temporal; use Friendica\Util\XML; @@ -593,7 +592,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o 'name' => $profile_name, 'sparkle' => $sparkle, 'lock' => $lock, - 'thumb' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'thumb' => DI::baseUrl()->remove($item['author-avatar']), 'title' => $title, 'body' => $body, 'tags' => $tags['tags'], @@ -613,7 +612,7 @@ function conversation(App $a, array $items, $mode, $update, $preview = false, $o 'indent' => '', 'owner_name' => $owner_name, 'owner_url' => $owner_url, - 'owner_photo' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'owner_photo' => DI::baseUrl()->remove($item['owner-avatar']), 'plink' => Item::getPlink($item), 'edpost' => false, 'isstarred' => $isstarred, diff --git a/mod/message.php b/mod/message.php index 204b136f9..f04bdaecd 100644 --- a/mod/message.php +++ b/mod/message.php @@ -32,7 +32,6 @@ use Friendica\Model\Mail; use Friendica\Model\Notify\Type; use Friendica\Module\Security\Login; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\Temporal; @@ -393,12 +392,8 @@ function message_content(App $a) $body_e = BBCode::convert($message['body']); $to_name_e = $message['name']; - $contact = Contact::getByURL($message['from-url'], false, ['thumb', 'addr']); - if (isset($contact["thumb"])) { - $from_photo = $contact["thumb"]; - } else { - $from_photo = $message['from-photo']; - } + $contact = Contact::getByURL($message['from-url'], false, ['thumb', 'addr', 'id', 'avatar']); + $from_photo = Contact::getThumb($contact, $message['from-photo']); $mails[] = [ 'id' => $message['id'], @@ -406,7 +401,7 @@ function message_content(App $a) 'from_url' => $from_url, 'from_addr' => $contact['addr'], 'sparkle' => $sparkle, - 'from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB), + 'from_photo' => $from_photo, 'subject' => $subject_e, 'body' => $body_e, 'delete' => DI::l10n()->t('Delete message'), @@ -525,12 +520,8 @@ function render_messages(array $msg, $t) $body_e = $rr['body']; $to_name_e = $rr['name']; - $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr']); - if (isset($contact["thumb"])) { - $from_photo = $contact["thumb"]; - } else { - $from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']); - } + $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']); + $from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']); $rslt .= Renderer::replaceMacros($tpl, [ '$id' => $rr['id'], @@ -538,7 +529,7 @@ function render_messages(array $msg, $t) '$from_url' => Contact::magicLink($rr['url']), '$from_addr' => $contact['addr'] ?? '', '$sparkle' => ' sparkle', - '$from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB), + '$from_photo' => $from_photo, '$subject' => $rr['title'], '$delete' => DI::l10n()->t('Delete conversation'), '$body' => $body_e, diff --git a/mod/network.php b/mod/network.php index d82072754..eb1dbdb04 100644 --- a/mod/network.php +++ b/mod/network.php @@ -572,7 +572,7 @@ function networkThreadedView(App $a, $update, $parent) '$title' => DI::l10n()->t('Group: %s', $group['name']) ]) . $o; } elseif ($cid) { - $fields = ['id', 'name', 'network', 'writable', 'nurl', + $fields = ['id', 'name', 'network', 'writable', 'nurl', 'avatar', 'forum', 'prv', 'contact-type', 'addr', 'thumb', 'location']; $condition = ["`id` = ? AND (NOT `blocked` OR `pending`)", $cid]; $contact = DBA::selectFirst('contact', $fields, $condition); diff --git a/mod/ping.php b/mod/ping.php index c6e32a931..7c8d6c846 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -327,7 +327,7 @@ function ping_init(App $a) if (DBA::isResult($notifs)) { foreach ($notifs as $notif) { - $contact = Contact::getByURL($notif['url'], false, ['micro']); + $contact = Contact::getByURL($notif['url'], false, ['micro', 'id', 'avatar']); $notif['photo'] = Contact::getMicro($contact, $notif['photo']); $local_time = DateTimeFormat::local($notif['date']); diff --git a/mod/suggest.php b/mod/suggest.php index 66d22b001..d592537f4 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -27,7 +27,6 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\GContact; -use Friendica\Util\Proxy as ProxyUtils; function suggest_init(App $a) { @@ -111,7 +110,7 @@ function suggest_content(App $a) 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']), 'img_hover' => $rr['url'], 'name' => $contact_details['name'], - 'thumb' => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB), + 'thumb' => Contact::getThumb($contact_details), 'details' => $contact_details['location'], 'tags' => $contact_details['keywords'], 'about' => $contact_details['about'], diff --git a/src/Content/ForumManager.php b/src/Content/ForumManager.php index 9441e9dbb..980e82522 100644 --- a/src/Content/ForumManager.php +++ b/src/Content/ForumManager.php @@ -27,7 +27,6 @@ use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Util\Proxy as ProxyUtils; /** * This class handles methods related to the forum functionality @@ -72,7 +71,7 @@ class ForumManager $forumlist = []; - $fields = ['id', 'url', 'name', 'micro', 'thumb']; + $fields = ['id', 'url', 'name', 'micro', 'thumb', 'avatar']; $condition = [$condition_str, Protocol::DFRN, Protocol::ACTIVITYPUB, $uid]; $contacts = DBA::select('contact', $fields, $condition, $params); if (!$contacts) { @@ -131,7 +130,7 @@ class ForumManager 'name' => $contact['name'], 'cid' => $contact['id'], 'selected' => $selected, - 'micro' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), + 'micro' => DI::baseUrl()->remove(Contact::getMicro($contact)), 'id' => ++$id, ]; $entries[] = $entry; diff --git a/src/Content/Text/HTML.php b/src/Content/Text/HTML.php index b69f5abc2..7b8153b8a 100644 --- a/src/Content/Text/HTML.php +++ b/src/Content/Text/HTML.php @@ -30,7 +30,6 @@ use Friendica\Core\Search; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Util\Network; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\XML; use League\HTMLToMarkdown\HtmlConverter; @@ -868,7 +867,7 @@ class HTML '$click' => $contact['click'] ?? '', '$class' => $class, '$url' => $url, - '$photo' => ProxyUtils::proxifyUrl($contact['thumb'], false, ProxyUtils::SIZE_THUMB), + '$photo' => Contact::getThumb($contact), '$name' => $contact['name'], 'title' => $contact['name'] . ' [' . $contact['addr'] . ']', '$parkle' => $sparkle, diff --git a/src/Content/Widget.php b/src/Content/Widget.php index fad863fbe..e8e70c0e1 100644 --- a/src/Content/Widget.php +++ b/src/Content/Widget.php @@ -34,7 +34,6 @@ use Friendica\Model\Group; use Friendica\Model\Item; use Friendica\Model\Profile; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\Temporal; @@ -432,10 +431,11 @@ class Widget $entries = []; foreach ($r as $rr) { + $contact = Contact::getByURL($rr['url']); $entry = [ 'url' => Contact::magicLink($rr['url']), - 'name' => $rr['name'], - 'photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_THUMB), + 'name' => $contact['name'] ?? $rr['name'], + 'photo' => Contact::getThumb($contact, $rr['photo']), ]; $entries[] = $entry; } diff --git a/src/Content/Widget/ContactBlock.php b/src/Content/Widget/ContactBlock.php index 47fac09a8..85c722c8a 100644 --- a/src/Content/Widget/ContactBlock.php +++ b/src/Content/Widget/ContactBlock.php @@ -98,7 +98,7 @@ class ContactBlock $contact_ids[] = $contact["id"]; } - $contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'network'], ['id' => $contact_ids]); + $contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'avatar', 'network'], ['id' => $contact_ids]); if (DBA::isResult($contacts_stmt)) { $contacts_title = DI::l10n()->tt('%d Contact', '%d Contacts', $total); diff --git a/src/Factory/Notification/Notification.php b/src/Factory/Notification/Notification.php index 982c2a7e0..ba36b0cef 100644 --- a/src/Factory/Notification/Notification.php +++ b/src/Factory/Notification/Notification.php @@ -97,7 +97,7 @@ class Notification extends BaseFactory $item['label'] = (($item['gravity'] == GRAVITY_PARENT) ? 'post' : 'comment'); $item['link'] = $this->baseUrl->get(true) . '/display/' . $item['parent-guid']; - $item['image'] = Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO); + $item['image'] = $item['author-avatar']; $item['url'] = $item['author-link']; $item['text'] = (($item['gravity'] == GRAVITY_PARENT) ? $this->l10n->t("%s created a new post", $item['author-name']) @@ -125,7 +125,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'like', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s liked %s's post", $item['author-name'], $item['parent-author-name']), 'when' => $item['when'], @@ -136,7 +136,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'dislike', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s disliked %s's post", $item['author-name'], $item['parent-author-name']), 'when' => $item['when'], @@ -147,7 +147,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'attend', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s is attending %s's event", $item['author-name'], $item['parent-author-name']), 'when' => $item['when'], @@ -158,7 +158,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'attendno', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s is not attending %s's event", $item['author-name'], $item['parent-author-name']), 'when' => $item['when'], @@ -169,7 +169,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'attendmaybe', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s may attending %s's event", $item['author-name'], $item['parent-author-name']), 'when' => $item['when'], @@ -196,7 +196,7 @@ class Notification extends BaseFactory return new \Friendica\Object\Notification\Notification([ 'label' => 'friend', 'link' => $this->baseUrl->get(true) . '/display/' . $item['parent-guid'], - 'image' => Proxy::proxifyUrl($item['author-avatar'], false, Proxy::SIZE_MICRO), + 'image' => $item['author-avatar'], 'url' => $item['author-link'], 'text' => $this->l10n->t("%s is now friends with %s", $item['author-name'], $item['fname']), 'when' => $item['when'], diff --git a/src/Module/BaseSearch.php b/src/Module/BaseSearch.php index 57b5976ef..08970f67d 100644 --- a/src/Module/BaseSearch.php +++ b/src/Module/BaseSearch.php @@ -31,7 +31,6 @@ use Friendica\Model; use Friendica\Network\HTTPException; use Friendica\Object\Search\ContactResult; use Friendica\Object\Search\ResultList; -use Friendica\Util\Proxy as ProxyUtils; /** * Base class for search modules @@ -160,13 +159,14 @@ class BaseSearch extends BaseModule } $photo = str_replace("http:///photo/", Search::getGlobalDirectory() . "/photo/", $result->getPhoto()); + $contact = Model\Contact::getByURL($result->getUrl()); $entry = [ 'alt_text' => $alt_text, 'url' => Model\Contact::magicLink($result->getUrl()), 'itemurl' => $result->getItem(), - 'name' => $result->getName(), - 'thumb' => ProxyUtils::proxifyUrl($photo, false, ProxyUtils::SIZE_THUMB), + 'name' => $contact['name'] ?? $result->getName(), + 'thumb' => Model\Contact::getThumb($contact, $photo), 'img_hover' => $result->getTags(), 'conntxt' => $connTxt, 'connlnk' => $connLink, diff --git a/src/Module/Contact.php b/src/Module/Contact.php index d21524a79..3fa89cde9 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -40,7 +40,6 @@ use Friendica\Module\Security\Login; use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\NotFoundException; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; /** @@ -1067,7 +1066,7 @@ class Contact extends BaseModule 'id' => $rr['id'], 'alt_text' => $alt_text, 'dir_icon' => $dir_icon, - 'thumb' => ProxyUtils::proxifyUrl($rr['thumb'], false, ProxyUtils::SIZE_THUMB), + 'thumb' => Model\Contact::getThumb($rr), 'name' => $rr['name'], 'username' => $rr['name'], 'account_type' => Model\Contact::getAccountType($rr), diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index 2c0cc967c..1e08adbe6 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -32,7 +32,6 @@ use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\Item; use Friendica\Network\HTTPException; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; /** @@ -83,14 +82,14 @@ class Acl extends BaseModule DI::logger()->warning('Wrong result item from Search::searchGlobalContact', ['$g' => $g, '$search' => $search, '$mode' => $mode, '$page' => $page]); continue; } - + $contact = Contact::getByURL($g['url']); $contacts[] = [ - 'photo' => ProxyUtils::proxifyUrl($g['photo'], false, ProxyUtils::SIZE_MICRO), - 'name' => htmlspecialchars($g['name']), - 'nick' => $g['addr'] ?: $g['url'], - 'network' => $g['network'], + 'photo' => Contact::getMicro($contact, $g['photo']), + 'name' => htmlspecialchars($contact['name'] ?? $g['name']), + 'nick' => $contact['nick'] ?? ($g['addr'] ?: $g['url']), + 'network' => $contact['network'] ?? $g['network'], 'link' => $g['url'], - 'forum' => !empty($g['community']) ? 1 : 0, + 'forum' => !empty($g['community']), ]; } @@ -231,7 +230,7 @@ class Acl extends BaseModule $r = []; switch ($type) { case self::TYPE_MENTION_CONTACT_GROUP: - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv`, (`prv` OR `forum`) AS `frm` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `avatar`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv`, (`prv` OR `forum`) AS `frm` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `deleted` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != '' AND NOT (`network` IN ('%s', '%s')) $sql_extra2 @@ -243,7 +242,7 @@ class Acl extends BaseModule break; case self::TYPE_MENTION_CONTACT: - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `avatar`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `deleted` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != '' AND NOT (`network` IN ('%s')) $sql_extra2 @@ -254,7 +253,7 @@ class Acl extends BaseModule break; case self::TYPE_MENTION_FORUM: - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `avatar`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `deleted` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `notify` != '' AND NOT (`network` IN ('%s')) AND (`forum` OR `prv`) @@ -266,7 +265,7 @@ class Acl extends BaseModule break; case self::TYPE_PRIVATE_MESSAGE: - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `avatar`, `micro`, `network`, `url`, `attag`, `addr` FROM `contact` WHERE `uid` = %d AND NOT `self` AND NOT `deleted` AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `network` IN ('%s', '%s', '%s') $sql_extra2 @@ -280,7 +279,7 @@ class Acl extends BaseModule case self::TYPE_ANY_CONTACT: default: - $r = q("SELECT `id`, `name`, `nick`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv` FROM `contact` + $r = q("SELECT `id`, `name`, `nick`, `avatar`, `micro`, `network`, `url`, `attag`, `addr`, `forum`, `prv`, `avatar` FROM `contact` WHERE `uid` = %d AND NOT `deleted` AND NOT `pending` AND NOT `archive` $sql_extra2 ORDER BY `name`", @@ -350,7 +349,7 @@ class Acl extends BaseModule continue; } - $contact = Contact::getByURL($author, false, ['micro', 'name', 'id', 'network', 'nick', 'addr', 'url', 'forum']); + $contact = Contact::getByURL($author, false, ['micro', 'name', 'id', 'network', 'nick', 'addr', 'url', 'forum', 'avatar']); if (count($contact) > 0) { $unknown_contacts[] = [ diff --git a/src/Object/Post.php b/src/Object/Post.php index ee886c157..a9d2f8634 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -38,7 +38,6 @@ use Friendica\Model\User; use Friendica\Protocol\Activity; use Friendica\Util\Crypto; use Friendica\Util\DateTimeFormat; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; use Friendica\Util\Temporal; @@ -447,7 +446,7 @@ class Post 'profile_url' => $profile_link, 'item_photo_menu' => item_photo_menu($item), 'name' => $name_e, - 'thumb' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'thumb' => DI::baseUrl()->remove($item['author-avatar']), 'osparkle' => $osparkle, 'sparkle' => $sparkle, 'title' => $title_e, @@ -461,7 +460,7 @@ class Post 'shiny' => $shiny, 'owner_self' => $item['author-link'] == Session::get('my_url'), 'owner_url' => $this->getOwnerUrl(), - 'owner_photo' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)), + 'owner_photo' => DI::baseUrl()->remove($item['owner-avatar']), 'owner_name' => $owner_name_e, 'plink' => Item::getPlink($item), 'edpost' => $edpost, diff --git a/view/theme/vier/theme.php b/view/theme/vier/theme.php index fdcc8f11d..3f7a1a66a 100644 --- a/view/theme/vier/theme.php +++ b/view/theme/vier/theme.php @@ -18,7 +18,6 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; use Friendica\Model\GContact; -use Friendica\Util\Proxy as ProxyUtils; use Friendica\Util\Strings; function vier_init(App $a) @@ -127,11 +126,12 @@ function vier_community_info() $aside['$comunity_profiles_items'] = []; foreach ($r as $rr) { + $contact = Contact::getByURL($rr['url']); $entry = Renderer::replaceMacros($tpl, [ '$id' => $rr['id'], '$profile_link' => 'follow/?url='.urlencode($rr['url']), - '$photo' => ProxyUtils::proxifyUrl($rr['photo'], false, ProxyUtils::SIZE_MICRO), - '$alt_text' => $rr['name'], + '$photo' => Contact::getMicro($contact, $rr['photo']), + '$alt_text' => $contact['name'] ?? $rr['name'], ]); $aside['$comunity_profiles_items'][] = $entry; } @@ -207,7 +207,7 @@ function vier_community_info() 'name' => $contact['name'], 'cid' => $contact['id'], 'selected' => $selected, - 'micro' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($contact['micro'], false, ProxyUtils::SIZE_MICRO)), + 'micro' => Contact::getMicro($contact), 'id' => ++$id, ]; $entries[] = $entry;