make sure to hide ALL autojanny notifs generated by shadowbanned-cels from non-jannies

pull/211/head
Aevann 2023-10-05 11:43:52 +03:00
parent fea6fc480f
commit 9dc48c7acf
1 changed files with 3 additions and 0 deletions

View File

@ -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)