Merge pull request #7911 from annando/acl

ACL: Contact list is now sorted, forums reappeared
2022.09-rc
Hypolite Petovan 2019-12-06 04:11:36 -05:00 zatwierdzone przez GitHub
commit f8569ac3c4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -258,10 +258,20 @@ class ACL extends BaseObject
*/
public static function getContactListByUserId(int $user_id)
{
$acl_contacts = Contact::selectToArray(
['id', 'name', 'addr', 'micro'],
['uid' => $user_id, 'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]]
$fields = ['id', 'name', 'addr', 'micro'];
$params = ['order' => ['name']];
$acl_contacts = Contact::selectToArray($fields,
['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false,
'pending' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]], $params
);
$acl_forums = Contact::selectToArray($fields,
['uid' => $user_id, 'self' => false, 'blocked' => false, 'archive' => false, 'deleted' => false,
'pending' => false, 'contact-type' => Contact::TYPE_COMMUNITY], $params
);
$acl_contacts = array_merge($acl_forums, $acl_contacts);
array_walk($acl_contacts, function (&$value) {
$value['type'] = 'contact';
});