Stop deleting notifications to private messages after reply.

This commit is contained in:
Ben Rog-Wilhelm 2023-08-09 02:33:17 -05:00
parent 7d1ff848d8
commit 2adae47b19

View file

@ -524,10 +524,6 @@ def messagereply(v):
if not notif: if not notif:
notif = Notification(comment_id=c.id, user_id=user_id) notif = Notification(comment_id=c.id, user_id=user_id)
g.db.add(notif) g.db.add(notif)
ids = [c.top_comment.id] + [x.id for x in c.top_comment.replies_ignoring_shadowbans]
notifications = g.db.query(Notification).filter(Notification.comment_id.in_(ids), Notification.user_id == user_id)
for n in notifications:
g.db.delete(n)
if PUSHER_ID != 'blahblahblah' and not v.shadowbanned: if PUSHER_ID != 'blahblahblah' and not v.shadowbanned:
if len(message) > 500: notifbody = message[:500] + '...' if len(message) > 500: notifbody = message[:500] + '...'
@ -563,11 +559,6 @@ def messagereply(v):
notif = Notification(comment_id=c.id, user_id=admin.id) notif = Notification(comment_id=c.id, user_id=admin.id)
g.db.add(notif) g.db.add(notif)
ids = [c.top_comment.id] + [x.id for x in c.top_comment.replies_ignoring_shadowbans]
notifications = g.db.query(Notification).filter(Notification.comment_id.in_(ids))
for n in notifications:
g.db.delete(n)
g.db.commit() g.db.commit()
return {"comment": render_template("comments.html", v=v, comments=[c], ajax=True)} return {"comment": render_template("comments.html", v=v, comments=[c], ajax=True)}