Use DBA::update() instead of raw SQL for marking circle posts as read

This commit is contained in:
“Raroun” 2026-02-16 08:59:01 +01:00
commit 170bcb4df8

View file

@ -216,14 +216,7 @@ class Circle extends BaseModule
$circle_id = intval(DI::args()->getArgv()[2]);
if ($circle_id && Model\Circle::exists($circle_id, DI::userSession()->getLocalUserId())) {
DBA::e(
"UPDATE `post-user`
SET `unseen` = 0
WHERE `uid` = ? AND `unseen` = 1
AND `contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)",
DI::userSession()->getLocalUserId(),
$circle_id
);
DBA::update('post-user', ['unseen' => false], ["`uid` = ? AND `unseen` AND `contact-id` IN (SELECT `contact-id` FROM `group_member` WHERE `gid` = ?)", DI::userSession()->getLocalUserId(), $circle_id]);
}
DI::baseUrl()->redirect('circle/' . $circle_id);
}