]> git.mxchange.org Git - friendica.git/commitdiff
Remove non-top-level posts from notification labels when network sort order is "received"
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 3 Nov 2022 00:45:42 +0000 (20:45 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 4 Nov 2022 10:42:38 +0000 (06:42 -0400)
- These posts don't alter the network view in this sort order and so are distracting with no actionable benefits

src/Module/Notifications/Ping.php

index 2d9110570036a373282ded30e4ae50118ca78867..e80d3b8ee03f3c97c172daeed7d2a1f9db4b7e1e 100644 (file)
@@ -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'],