forked from rDrama/rDrama
1
0
Fork 0

make sure shadowbanned-cels cant generate push notifs

master
Aevann 2023-08-20 05:36:43 +03:00
parent 81e8d09cd1
commit e1eecfc0f2
3 changed files with 11 additions and 11 deletions

View File

@ -215,6 +215,9 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None, followers_pi
def push_notif(uids, title, body, url_or_comment):
if g.v.shadowbanned:
return
if VAPID_PUBLIC_KEY == DEFAULT_CONFIG_VALUE:
return

View File

@ -370,7 +370,7 @@ def comment(v):
n = Notification(comment_id=c.id, user_id=x)
g.db.add(n)
if parent_user.id != v.id and not v.shadowbanned:
if parent_user.id != v.id:
if isinstance(parent, User):
title = f"New comment on your wall by @{c.author_name}"
else:
@ -710,7 +710,6 @@ def edit_comment(cid, v):
if not notif:
n = Notification(comment_id=c.id, user_id=x)
g.db.add(n)
if not v.shadowbanned:
push_notif({x}, f'New mention of you by @{c.author_name}', c.body, c)

View File

@ -663,7 +663,6 @@ def message2(v, username=None, id=None):
g.db.add(notif)
if not v.shadowbanned:
title = f'New message from @{c.author_name}'
url = f'{SITE_FULL}/notifications/messages'
@ -745,7 +744,6 @@ def messagereply(v):
notif = Notification(comment_id=c.id, user_id=user_id)
g.db.add(notif)
if not v.shadowbanned:
title = f'New message from @{c.author_name}'
url = f'{SITE_FULL}/notifications/messages'