From 5a511c00a87cb78fe6e45967d9b626a6aeecefbc Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 24 Feb 2023 04:22:47 +0200 Subject: [PATCH] include username in push notifs --- files/helpers/offsitementions.py | 2 +- files/helpers/sanitize.py | 4 ++-- files/routes/static.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/helpers/offsitementions.py b/files/helpers/offsitementions.py index 4b88ffb9e5..ac6174bad8 100644 --- a/files/helpers/offsitementions.py +++ b/files/helpers/offsitementions.py @@ -124,4 +124,4 @@ def notify_mentions(mentions, send_to=None, mention_str='site mention'): g.db.add(notif) g.db.flush() - push_notif({send_to}, f'New mention of you on reddit', new_comment.body, f'{SITE_FULL}/comment/{new_comment.id}?read=true#context') + push_notif({send_to}, f'New mention of you on reddit by /u/{author}', new_comment.body, f'{SITE_FULL}/comment/{new_comment.id}?read=true#context') diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 0404002963..91120390e5 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -230,13 +230,13 @@ def execute_blackjack(v, target, body, type): g.db.add(n) g.db.flush() - push_notif(notified_ids, 'Blackjack!', target.body, (target.id,bool(target.wall_user_id))) + push_notif(notified_ids, f'Blackjack by @{v.username}', target.body, (target.id,bool(target.wall_user_id))) extra_info = None if extra_info: for id in notified_ids: - send_repeatable_notification_duplicated(id, f"Blackjack for @{v.username}: {extra_info}") + send_repeatable_notification_duplicated(id, f"Blackjack by @{v.username}: {extra_info}") return True def render_emoji(html, regexp, golden, marseys_used, b=False): diff --git a/files/routes/static.py b/files/routes/static.py index 9f57704aff..bf202f1bb9 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -259,7 +259,7 @@ def submit_contact(v): g.db.add(notif) g.db.flush() - push_notif(admin_ids, 'New modmail', new_comment.body, f'{SITE_FULL}/notifications/modmail') + push_notif(admin_ids, f'New modmail from @{v.username}', new_comment.body, f'{SITE_FULL}/notifications/modmail') return redirect("/contact?msg=Your message has been sent to the admins!")