]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact/Contacts.php
Merge pull request #13042 from annando/support-probe
[friendica.git] / src / Module / Contact / Contacts.php
index 33fe2f60d5136015ca7143b5c31f88ed7d3e66d2..e82a3312d2b02fa69c54d853a4ae7eefb85ac75d 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
  *
@@ -143,7 +143,18 @@ class Contacts extends BaseModule
 
                $tabs = self::getContactFilterTabs('contact/' . $cid, $type, true);
 
-               $contacts = array_map([Module\Contact::class, 'getContactTemplateVars'], $friends);
+               // Contact list is obtained from the visited contact, but the contact display is visitor dependent
+               $contacts = array_map(
+                       function ($contact) {
+                               $contact = Model\Contact::selectFirst(
+                                       [],
+                                       ['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
+                                       ['order' => ['uid' => 'DESC']]
+                               );
+                               return Module\Contact::getContactTemplateVars($contact);
+                       },
+                       $friends
+               );
 
                $tpl = Renderer::getMarkupTemplate('profile/contacts.tpl');
                $o .= Renderer::replaceMacros($tpl, [