]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/Widget/VCard.php
Merge pull request #12951 from jsoref/spelling
[friendica.git] / src / Content / Widget / VCard.php
index 3a29522cfe90cc49cdfd02403a285e326d2527b1..e462ab0aaa466c0868700c42812a0bd53a7eb9e0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -44,7 +44,7 @@ class VCard
         * @template widget/vcard.tpl
         * @return string
         */
-       public static function getHTML(array $contact)
+       public static function getHTML(array $contact): string
        {
                if (!isset($contact['network']) || !isset($contact['id'])) {
                        Logger::warning('Incomplete contact', ['contact' => $contact ?? [], 'callstack' => System::callstack(20)]);
@@ -70,7 +70,7 @@ class VCard
                                $rel     = $contact['rel'];
                                $pending = $contact['pending'];
                        } else {
-                               $pcontact = Contact::selectFirst([], ['uid' => DI::userSession()->getLocalUserId(), '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;
@@ -83,9 +83,9 @@ class VCard
 
                        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';
                                }
                        }