dont send push notif when shadowbeaned

master
Aevann 2024-04-09 17:02:56 +02:00
parent 594f32e703
commit a51125e21b
1 changed files with 5 additions and 6 deletions

View File

@ -379,12 +379,11 @@ def messagereply(v):
execute_blackjack(v, c, c.body_html, 'message') execute_blackjack(v, c, c.body_html, 'message')
execute_under_siege(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 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):
if can_see(user, v): notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none() if not notif:
if not notif: notif = Notification(comment_id=c.id, user_id=user_id)
notif = Notification(comment_id=c.id, user_id=user_id) g.db.add(notif)
g.db.add(notif)
title = f'New message from @{c.author_name}' title = f'New message from @{c.author_name}'
url = f'{SITE_FULL}/notifications/messages' url = f'{SITE_FULL}/notifications/messages'