<?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
*
'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) {
$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 $contact ? Module\Contact::getContactTemplateVars($contact) : null;
+ },
+ Model\Contact::selectToArray(['uri-id'], $condition, $params)
);
+ // Remove nonexistent contacts
+ $contacts = array_filter($contacts);
+
$desc = '';
switch ($type) {
case 'followers':