]> git.mxchange.org Git - friendica.git/commitdiff
Retrieve contact records for the page visitor in Contact\Contacts module
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 17 Dec 2022 05:39:06 +0000 (00:39 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 14:50:17 +0000 (09:50 -0500)
src/Module/Contact/Contacts.php

index 33fe2f60d5136015ca7143b5c31f88ed7d3e66d2..0ed91c927232afaeaae6544a281a9e4fa0d83249 100644 (file)
@@ -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, [