X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FNotifications%2FPing.php;h=76cdd9f77055ce967968eda5d712fd6e07e3d651;hb=f9ab5b0669864ecb6a5771c60f21ee42bee9a3a1;hp=2d9110570036a373282ded30e4ae50118ca78867;hpb=8092bfe27722ca310803a671af606a4b24bb5aad;p=friendica.git diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php index 2d91105700..76cdd9f770 100644 --- a/src/Module/Notifications/Ping.php +++ b/src/Module/Notifications/Ping.php @@ -128,6 +128,11 @@ class Ping extends BaseModule $this->session->getLocalUserId(), Verb::getID(Activity::FOLLOW) ]; + // No point showing counts for non-top-level posts when the network page is ordered by received field + if (Network::getTimelineOrderBySession($this->session, $this->pconfig) == 'received') { + $condition = DBA::mergeConditions($condition, ["`parent` = `id`"]); + } + $items_unseen = $this->database->toArray(Post::selectForUser( $this->session->getLocalUserId(), ['wall', 'uid', 'uri-id'], @@ -228,26 +233,22 @@ class Ping extends BaseModule } if (count($registrations) <= 1 || $this->pconfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) { - foreach ($registrations as $reg) { + foreach ($registrations as $registration) { $navNotifications[] = $this->formattedNavNotification->createFromParams( - [ - 'name' => $reg['name'], - 'url' => $reg['url'], - ], + $registration['name'], + $registration['url'], $this->l10n->t('{0} requested registration'), - new \DateTime($reg['created'], new \DateTimeZone('UTC')), - new Uri($this->baseUrl->get(true) . '/admin/users/pending') + new \DateTime($registration['created'], new \DateTimeZone('UTC')), + new Uri($this->baseUrl->get(true) . '/moderation/users/pending') ); } } elseif (count($registrations) > 1) { $navNotifications[] = $this->formattedNavNotification->createFromParams( - [ - 'name' => $registrations[0]['name'], - 'url' => $registrations[0]['url'], - ], + $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) . '/admin/users/pending') + new Uri($this->baseUrl->get(true) . '/moderation/users/pending') ); }