Fix: The calculation of unseen circles can now be deactivated again

This commit is contained in:
Michael 2023-10-05 17:06:21 +00:00
parent eb50618fe8
commit 174fa49b23
6 changed files with 21 additions and 10 deletions

View file

@ -169,16 +169,17 @@ class Circle
*
* Count unread items of each circle of the local user
*
* @param int $uid
* @return array
* 'id' => circle id
* 'name' => circle name
* 'count' => counted unseen circle items
* @throws \Exception
*/
public static function countUnseen()
public static function countUnseen(int $uid)
{
$stmt = DBA::p("SELECT `circle`.`id`, `circle`.`name`,
(SELECT COUNT(*) FROM `post-user-view`
(SELECT COUNT(*) FROM `post-user`
WHERE `uid` = ?
AND `unseen`
AND `contact-id` IN
@ -188,8 +189,8 @@ class Circle
) AS `count`
FROM `group` AS `circle`
WHERE `circle`.`uid` = ?;",
DI::userSession()->getLocalUserId(),
DI::userSession()->getLocalUserId()
$uid,
$uid
);
return DBA::toArray($stmt);