]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Profile/Contacts.php
Merge remote-tracking branch 'upstream/2023.03-rc' into npf2
[friendica.git] / src / Module / Profile / Contacts.php
index 81ccd500d5e56a332fa13b8bf00ff5a7cd99daaa..dde138d8cc93c9a60a956d4c2628da4363533f74 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
  *
@@ -92,7 +92,7 @@ class Contacts extends Module\BaseProfile
                        'archive' => false,
                        'failed'  => false,
                        'self'    => false,
-                       'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, Protocol::FEED]
+                       'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]
                ];
 
                switch ($type) {
@@ -113,9 +113,17 @@ class Contacts extends Module\BaseProfile
 
                $params = ['order' => ['name' => false], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
 
+               // Contact list is obtained from the visited profile user, but the contact display is visitor dependent
                $contacts = array_map(
-                       [Module\Contact::class, 'getContactTemplateVars'],
-                       Model\Contact::selectToArray([], $condition, $params)
+                       function ($contact) {
+                               $contact = Model\Contact::selectFirst(
+                                       [],
+                                       ['uri-id' => $contact['uri-id'], 'uid' => [0, $this->userSession->getLocalUserId()]],
+                                       ['order' => ['uid' => 'DESC']]
+                               );
+                               return Module\Contact::getContactTemplateVars($contact);
+                       },
+                       Model\Contact::selectToArray(['uri-id'], $condition, $params)
                );
 
                $desc = '';