]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Notifications/Ping.php
Merge remote-tracking branch 'upstream/develop' into diaspora-item
[friendica.git] / src / Module / Notifications / Ping.php
index 76cdd9f77055ce967968eda5d712fd6e07e3d651..15c775d201fa3f78a978e337b95cc33f669db641 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -48,6 +48,7 @@ use Friendica\Navigation\Notifications\Factory;
 use Friendica\Navigation\Notifications\Repository;
 use Friendica\Navigation\Notifications\ValueObject;
 use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException;
 use Friendica\Protocol\Activity;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Profiler;
@@ -115,8 +116,8 @@ class Ping extends BaseModule
                $birthday_count       = 0;
                $today_birthday_count = 0;
 
-
-               if ($this->session->getLocalUserId()) {
+               // Suppress notification display for forum accounts
+               if ($this->session->getLocalUserId() && $this->session->get('page_flags', '') != User::PAGE_FLAGS_COMMUNITY) {
                        if ($this->pconfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) {
                                $notifications = $this->notificationRepo->selectDetailedForUser($this->session->getLocalUserId());
                        } else {
@@ -229,7 +230,11 @@ class Ping extends BaseModule
 
                        // merge all notification types in one array
                        foreach ($intros as $intro) {
-                               $navNotifications[] = $this->formattedNavNotification->createFromIntro($intro);
+                               try {
+                                       $navNotifications[] = $this->formattedNavNotification->createFromIntro($intro);
+                               } catch (HTTPException\NotFoundException $e) {
+                                       $this->introductionRepo->delete($intro);
+                               }
                        }
 
                        if (count($registrations) <= 1 || $this->pconfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) {
@@ -242,7 +247,7 @@ class Ping extends BaseModule
                                                new Uri($this->baseUrl->get(true) . '/moderation/users/pending')
                                        );
                                }
-                       } elseif (count($registrations) > 1) {
+                       } else {
                                $navNotifications[] = $this->formattedNavNotification->createFromParams(
                                        $registrations[0]['name'],
                                        $registrations[0]['url'],