From c280fc648498c0155c0e985b76b97ea54a267001 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 6 Jan 2019 17:08:58 -0500 Subject: [PATCH] Show followers for pages, followed for users in ContactBlock widget --- src/Content/Widget/ContactBlock.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Content/Widget/ContactBlock.php b/src/Content/Widget/ContactBlock.php index 12cd4cd87..33f72af40 100644 --- a/src/Content/Widget/ContactBlock.php +++ b/src/Content/Widget/ContactBlock.php @@ -14,6 +14,7 @@ use Friendica\Core\Protocol; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\Model\Contact; +use Friendica\Model\User; /** * ContactBlock widget @@ -59,6 +60,13 @@ class ContactBlock if (!$total) { $micropro = []; } else { + // Only show followed for personal accounts, followers for pages + if (defaults($profile, 'account-type', User::ACCOUNT_TYPE_PERSON) == User::ACCOUNT_TYPE_PERSON) { + $rel = [Contact::FOLLOWER, Contact::FRIEND]; + } else { + $rel = [Contact::SHARING, Contact::FRIEND]; + } + $contact_ids_stmt = DBA::select('contact', ['id'], [ 'uid' => $profile['uid'], 'self' => false, @@ -66,7 +74,7 @@ class ContactBlock 'pending' => false, 'hidden' => false, 'archive' => false, - 'rel' => [Contact::FOLLOWER, Contact::FRIEND], + 'rel' => $rel, 'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA], ], ['limit' => $shown]);