From 9dc48c7acfc5e2f31a5d1937c5b825e103c918d5 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 5 Oct 2023 11:43:52 +0300 Subject: [PATCH] make sure to hide ALL autojanny notifs generated by shadowbanned-cels from non-jannies --- files/helpers/alerts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 0d5bd846c..5be756c3f 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -111,6 +111,9 @@ def notif_comment2(p): def add_notif(cid, uid, text, pushnotif_url=''): if uid in BOT_IDs: return + if hasattr(g, 'v') and g.v and g.v.shadowbanned and g.db.query(User.admin_level).filter_by(id=uid).one()[0] < PERMS['USER_SHADOWBAN']: + return + existing = g.db.query(Notification.user_id).filter_by(comment_id=cid, user_id=uid).one_or_none() if not existing: notif = Notification(comment_id=cid, user_id=uid)