From a51125e21b475b9a2f97c9f2b01a14db23ed84c0 Mon Sep 17 00:00:00 2001 From: Aevann Date: Tue, 9 Apr 2024 17:02:56 +0200 Subject: [PATCH] dont send push notif when shadowbeaned --- files/routes/chat.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/files/routes/chat.py b/files/routes/chat.py index 1f9c89aff..babc22e12 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -379,12 +379,11 @@ def messagereply(v): execute_blackjack(v, c, c.body_html, 'message') execute_under_siege(v, c, c.body_html, 'message') - if user_id and user_id not in {v.id, MODMAIL_ID} | BOT_IDs and user_id not in online["messages"]: - if can_see(user, v): - notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none() - if not notif: - notif = Notification(comment_id=c.id, user_id=user_id) - g.db.add(notif) + if user_id and user_id not in {v.id, MODMAIL_ID} | BOT_IDs and user_id not in online["messages"] and can_see(user, v): + notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none() + if not notif: + notif = Notification(comment_id=c.id, user_id=user_id) + g.db.add(notif) title = f'New message from @{c.author_name}' url = f'{SITE_FULL}/notifications/messages'