]> git.mxchange.org Git - friendica.git/blobdiff - src/Content/ForumManager.php
"inform" functionality moved / unified functionality
[friendica.git] / src / Content / ForumManager.php
index 424f54e0cafe118786a0bdb1f93ab3c29da07b1a..0104d388f59f9b557900d0919face9e4dbcb7c7a 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -209,14 +209,15 @@ class ForumManager
        public static function countUnseenItems()
        {
                $stmtContacts = DBA::p(
-                       "SELECT `contact`.`id`, `contact`.`name`, COUNT(*) AS `count` FROM `post-view`
-                               INNER JOIN `contact` ON `post-view`.`contact-id` = `contact`.`id`
-                               WHERE `post-view`.`uid` = ? AND `post-view`.`visible` AND NOT `post-view`.`deleted` AND `post-view`.`unseen`
+                       "SELECT `contact`.`id`, `contact`.`name`, COUNT(*) AS `count` FROM `post-user-view`
+                               INNER JOIN `contact` ON `post-user-view`.`contact-id` = `contact`.`id`
+                               WHERE `post-user-view`.`uid` = ? AND `post-user-view`.`visible` AND NOT `post-user-view`.`deleted` AND `post-user-view`.`unseen`
                                AND `contact`.`network` IN (?, ?) AND `contact`.`contact-type` = ?
                                AND NOT `contact`.`blocked` AND NOT `contact`.`hidden`
                                AND NOT `contact`.`pending` AND NOT `contact`.`archive`
+                               AND `contact`.`uid` = ?
                                GROUP BY `contact`.`id`",
-                       local_user(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY
+                       local_user(), Protocol::DFRN, Protocol::ACTIVITYPUB, Contact::TYPE_COMMUNITY, local_user()
                );
 
                return DBA::toArray($stmtContacts);