From: Michael <heluecht@pirati.ca>
Date: Fri, 6 Dec 2019 07:25:21 +0000 (+0000)
Subject: ACL: Contact list is now sorted, forums reappeared
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b1fa0e8e268b5a49d548d0b2446f8998f878740f;p=friendica.git

ACL: Contact list is now sorted, forums reappeared
---

diff --git a/src/Core/ACL.php b/src/Core/ACL.php
index 044f61aebc..83fae423ac 100644
--- a/src/Core/ACL.php
+++ b/src/Core/ACL.php
@@ -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';
 		});