From e4a5094c908d84e3a39f6021c9ef96a31507e5fe Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Mar 2022 18:38:59 +0000 Subject: [PATCH] Don't show double introductions --- src/Module/Notifications/Ping.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php index 2f79b91f0d..1501c4277e 100644 --- a/src/Module/Notifications/Ping.php +++ b/src/Module/Notifications/Ping.php @@ -33,6 +33,7 @@ use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Group; use Friendica\Model\Post; +use Friendica\Model\User; use Friendica\Model\Verb; use Friendica\Module\Register; use Friendica\Module\Response; @@ -183,7 +184,12 @@ class Ping extends BaseModule } } - $navNotifications = array_map(function (Entity\Notification $notification) { + $owner = User::getOwnerDataById(local_user()); + + $navNotifications = array_map(function (Entity\Notification $notification) use ($owner) { + if (($notification->type == Post\UserNotification::TYPE_NONE) && in_array($owner['page-flags'], [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_PRVGROUP])) { + return null; + } try { return $this->formattedNavNotification->createFromNotification($notification); } catch (NoMessageException $e) {