X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FContent%2FWidget%2FVCard.php;h=e462ab0aaa466c0868700c42812a0bd53a7eb9e0;hb=f61fd93db02bc2d66e1473ca34dc1154e77217a3;hp=7f75c6c9c0e588a9c567d30cdc1a0530007a8c8a;hpb=7dadc7f6dc0b1e68bfa5937b3a3fa3fd9cdcacd1;p=friendica.git diff --git a/src/Content/Widget/VCard.php b/src/Content/Widget/VCard.php index 7f75c6c9c0..e462ab0aaa 100644 --- a/src/Content/Widget/VCard.php +++ b/src/Content/Widget/VCard.php @@ -1,6 +1,6 @@ $contact ?? [], 'callstack' => System::callstack(20)]); @@ -62,24 +62,30 @@ class VCard $unfollow_link = ''; $wallmessage_link = ''; - if (local_user()) { + $photo = Contact::getPhoto($contact); + + if (DI::userSession()->getLocalUserId()) { if ($contact['uid']) { $id = $contact['id']; $rel = $contact['rel']; $pending = $contact['pending']; } else { - $pcontact = Contact::selectFirst(['id', 'rel', 'pending'], ['uid' => local_user(), 'uri-id' => $contact['uri-id']]); + $pcontact = Contact::selectFirst([], ['uid' => DI::userSession()->getLocalUserId(), 'uri-id' => $contact['uri-id'], 'deleted' => false]); $id = $pcontact['id'] ?? 0; $rel = $pcontact['rel'] ?? Contact::NOTHING; $pending = $pcontact['pending'] ?? false; + + if (!empty($pcontact) && in_array($pcontact['network'], [Protocol::MAIL, Protocol::FEED])) { + $photo = Contact::getPhoto($pcontact); + } } if (empty($contact['self']) && Protocol::supportsFollow($contact['network'])) { if (in_array($rel, [Contact::SHARING, Contact::FRIEND])) { - $unfollow_link = 'unfollow?url=' . urlencode($contact['url']) . '&auto=1'; + $unfollow_link = 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1'; } elseif (!$pending) { - $follow_link = 'follow?url=' . urlencode($contact['url']) . '&auto=1'; + $follow_link = 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1'; } } @@ -90,7 +96,7 @@ class VCard return Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [ '$contact' => $contact, - '$photo' => Contact::getPhoto($contact), + '$photo' => $photo, '$url' => Contact::magicLinkByContact($contact, $contact['url']), '$about' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['about'] ?? ''), '$xmpp' => DI::l10n()->t('XMPP:'),