forked from rDrama/rDrama
1
0
Fork 0

fix marking read from push notifs

master
Aevann1 2022-12-05 16:38:24 +02:00
parent 99c12a74ad
commit 2b7f7cef1b
2 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,8 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None):
if notif:
notif.read = True
g.db.add(notif)
g.db.commit()
if not pid:
if comment.parent_submission: pid = comment.parent_submission
else: pid = NOTIFICATION_THREAD
@ -503,7 +504,7 @@ def wall_comment(v):
if len(c.body) > 500: notifbody = c.body[:500] + '...'
else: notifbody = c.body
url = f'{SITE_FULL}/comment/{c.id}?context=8&read=true#context'
url = f'{SITE_FULL}/@{c.wall_user.username}/wall/comment/{c.id}?context=8&read=true#context'
push_notif(parent_author.id, title, notifbody, url)

View File

@ -786,6 +786,7 @@ def u_username_wall_comment(username, cid, v=None):
if notif:
notif.read = True
g.db.add(notif)
g.db.commit()
try: context = min(int(request.values.get("context", 0)), 8)
except: context = 0