X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FNotifications%2FPing.php;h=3cd4d702010dc9e61c1e702618649e15014aaffa;hb=f0743e4e128dfcb5d6305f4ed09e969573ba6b15;hp=76cdd9f77055ce967968eda5d712fd6e07e3d651;hpb=71ab9e13f24e5340e1b278291d3c1d933a906514;p=friendica.git diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php index 76cdd9f770..3cd4d70201 100644 --- a/src/Module/Notifications/Ping.php +++ b/src/Module/Notifications/Ping.php @@ -1,6 +1,6 @@ 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')) { @@ -239,16 +244,16 @@ class Ping extends BaseModule $registration['url'], $this->l10n->t('{0} requested registration'), new \DateTime($registration['created'], new \DateTimeZone('UTC')), - new Uri($this->baseUrl->get(true) . '/moderation/users/pending') + new Uri($this->baseUrl . '/moderation/users/pending') ); } - } elseif (count($registrations) > 1) { + } else { $navNotifications[] = $this->formattedNavNotification->createFromParams( $registrations[0]['name'], $registrations[0]['url'], $this->l10n->t('{0} and %d others requested registration', count($registrations) - 1), new \DateTime($registrations[0]['created'], new \DateTimeZone('UTC')), - new Uri($this->baseUrl->get(true) . '/moderation/users/pending') + new Uri($this->baseUrl . '/moderation/users/pending') ); }