minor push notifs title fix

master
Aevann1 2022-12-20 05:08:58 +02:00
parent 169dc4ebef
commit 59738f5701
1 changed files with 7 additions and 4 deletions

View File

@ -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:
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 not posting_to_submission: title = f"New comment on your wall by @{c.author_name}"
if len(c.body) > PUSH_NOTIF_LIMIT: notifbody = c.body[:PUSH_NOTIF_LIMIT] + '...'
else: notifbody = c.body
if posting_to_submission:
url = f'{SITE_FULL}/comment/{c.id}?read=true'
if not posting_to_submission:
else:
url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?read=true'
push_notif(parent_user.id, title, notifbody, url)