]> git.mxchange.org Git - friendica.git/commitdiff
ACL: Contact list is now sorted, forums reappeared
authorMichael <heluecht@pirati.ca>
Fri, 6 Dec 2019 07:25:21 +0000 (07:25 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 6 Dec 2019 07:25:21 +0000 (07:25 +0000)
src/Core/ACL.php

index 044f61aebce5da518f10e7e5e61d6d46702dc90a..83fae423ac920aeb6aa6113fad96dcaf35e7e420 100644 (file)
@@ -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';
                });