From 59738f57013a9810e5db172709167409e6c7713c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 20 Dec 2022 05:08:58 +0200 Subject: [PATCH] minor push notifs title fix --- files/routes/comments.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 0ee050c17..2423e3c38 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -304,14 +304,17 @@ def comment(v:User): g.db.add(n) if VAPID_PUBLIC_KEY != DEFAULT_CONFIG_VALUE and parent_user.id != v.id and not v.shadowbanned: - title = f'New reply by @{c.author_name}' - if not posting_to_submission: title = f"New comment on your wall by @{c.author_name}" + if isinstance(parent, User): + title = f"New comment on your wall by @{c.author_name}" + else: + title = f'New reply by @{c.author_name}' if len(c.body) > PUSH_NOTIF_LIMIT: notifbody = c.body[:PUSH_NOTIF_LIMIT] + '...' else: notifbody = c.body - url = f'{SITE_FULL}/comment/{c.id}?read=true' - if not posting_to_submission: + if posting_to_submission: + url = f'{SITE_FULL}/comment/{c.id}?read=true' + else: url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true' push_notif(parent_user.id, title, notifbody, url)