hide ghosts in push notifs

pull/136/head
Aevann 2023-02-27 15:35:53 +02:00
parent 27b2adf989
commit 9559c6e93a
4 changed files with 8 additions and 8 deletions

View File

@ -262,7 +262,7 @@ def execute_zozbot(c:Comment, level:int, post_target:post_target_type, v):
post_target.comment_count += 3
g.db.add(post_target)
push_notif({v.id}, 'New reply by @zozbot', "zoz", c2)
push_notif({v.id}, f'New reply by @{c2.author_name}', "zoz", c2)
def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_target_type, v:User):
if SITE_NAME != 'rDrama': return
@ -308,7 +308,7 @@ def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_
post_target.comment_count += 3
g.db.add(post_target)
push_notif({v.id}, 'New reply by @longpostbot', c2.body, c2)
push_notif({v.id}, f'New reply by @{c2.author_name}', c2.body, c2)
def execute_antispam_submission_check(title, v, url):
now = int(time.time())

View File

@ -310,14 +310,14 @@ def comment(v:User):
if not v.shadowbanned:
notify_users = NOTIFY_USERS(body, v)
push_notif(notify_users, f'New mention of you by @{v.username}', c.body, c)
push_notif(notify_users, f'New mention of you by @{c.author_name}', c.body, c)
if c.level == 1 and posting_to_submission:
subscriber_ids = [x[0] for x in g.db.query(Subscription.user_id).filter(Subscription.submission_id == post_target.id, Subscription.user_id != v.id).all()]
notify_users.update(subscriber_ids)
push_notif(subscriber_ids, f'New comment in subscribed thread by @{v.username}', c.body, c)
push_notif(subscriber_ids, f'New comment in subscribed thread by @{c.author_name}', c.body, c)
if parent_user.id != v.id:
notify_users.add(parent_user.id)
@ -448,7 +448,7 @@ def edit_comment(cid, v):
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 @{v.username}', c.body, c)
push_notif({x}, f'New mention of you by @{c.author_name}', c.body, c)
g.db.commit()
return {"body": c.body, "comment": c.realbody(v)}

View File

@ -280,7 +280,7 @@ def submit_contact(v):
notif = Notification(comment_id=new_comment.id, user_id=admin_id)
g.db.add(notif)
push_notif(admin_ids, f'New modmail from @{v.username}', new_comment.body, f'{SITE_FULL}/notifications/modmail')
push_notif(admin_ids, f'New modmail from @{new_comment.author_name}', new_comment.body, f'{SITE_FULL}/notifications/modmail')
return redirect("/contact?msg=Your message has been sent to the admins!")

View File

@ -553,7 +553,7 @@ def message2(v:User, username:str):
if not v.shadowbanned:
title = f'New message from @{v.username}'
title = f'New message from @{c.author_name}'
url = f'{SITE_FULL}/notifications/messages'
@ -619,7 +619,7 @@ def messagereply(v:User):
g.db.add(notif)
if not v.shadowbanned:
title = f'New message from @{v.username}'
title = f'New message from @{c.author_name}'
url = f'{SITE_FULL}/notifications/messages'