]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Common.php
Changes:
[friendica.git] / src / Module / Profile / Common.php
index 0abdd3ed6f2e5135a36b2a40d6991bdfb2091d6e..b5ac35f7640e7c595641646b03beaf9bef7788ea 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -100,7 +100,18 @@ class Common extends BaseProfile
 
                $commonFollows = Contact\Relation::listCommon($sourceId, $targetId, $condition, $pager->getItemsPerPage(), $pager->getStart());
 
-               $contacts = array_map([Module\Contact::class, 'getContactTemplateVars'], $commonFollows);
+               // Contact list is obtained from the visited profile user, but the contact display is visitor dependent
+               $contacts = array_map(
+                       function ($contact) {
+                               $contact = Contact::selectFirst(
+                                       [],
+                                       ['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
+                                       ['order' => ['uid' => 'DESC']]
+                               );
+                               return Module\Contact::getContactTemplateVars($contact);
+                       },
+                       $commonFollows
+               );
 
                $title = $this->tt('Common contact (%s)', 'Common contacts (%s)', $total);
                $desc = $this->t(