diff options
author | Mario <mario@mariovavti.com> | 2025-05-02 16:48:34 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2025-05-02 16:48:34 +0000 |
commit | dedab1ad4fb9ed7ea9aa3bf8b7517608dc040509 (patch) | |
tree | 70a2941ed53934b07d38b7434dd331f8715c6172 /Zotlabs/Module | |
parent | cf1a404945bc22670a599d188c088ce11c1fad16 (diff) | |
download | volse-hubzilla-dedab1ad4fb9ed7ea9aa3bf8b7517608dc040509.tar.gz volse-hubzilla-dedab1ad4fb9ed7ea9aa3bf8b7517608dc040509.tar.bz2 volse-hubzilla-dedab1ad4fb9ed7ea9aa3bf8b7517608dc040509.zip |
this performs way better
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Sse_bs.php | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index db219e1d2..d24cefe7c 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -118,7 +118,6 @@ class Sse_bs extends Controller { } function mark_read($arr) { - $mids = []; $str = ''; $slice = 0; @@ -154,24 +153,26 @@ class Sse_bs extends Controller { call_hooks('update_unseen',$x); if ($x['update'] === 'unset' || intval($x['update'])) { + q("UPDATE item SET + item_unseen = 0 + WHERE uid = %d + AND uuid in (%s) + AND item_unseen = 1", + intval(self::$uid), + $str // this is dbesc() in the above foreach loop + ); + q("UPDATE item SET item_unseen = 0 WHERE uid = %d - AND item_unseen = 1 - AND ( - uuid IN (%s) - OR - thr_parent IN ( - SELECT mid FROM item WHERE uid = %d AND uuid IN (%s) - ) - AND verb IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept') - )", + AND thr_parent IN (SELECT mid FROM item WHERE uid = %d AND uuid IN (%s)) + AND verb IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept') + AND item_unseen = 1", intval(self::$uid), - $str, // this is dbesc() in the above foreach loop intval(self::$uid), + $str, // this is dbesc() in the above foreach loop $str ); } - } function bs_network($notifications) { |