From 234fef2ba12ac62877adf0993c571e6c6515c153 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 26 Nov 2022 07:52:37 +0200 Subject: [PATCH] insanely ghetto solution to long back-and-forth chains in notifs --- files/routes/comments.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/files/routes/comments.py b/files/routes/comments.py index 2503431fd..bc19459c5 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -359,6 +359,13 @@ def comment(v): check_slots_command(v, v, c) + if c.level > 5: + n = g.db.query(Notification).filter_by( + comment_id=c.parent_comment.parent_comment.parent_comment.parent_comment_id, + user_id=c.parent_comment.author_id, + ).one_or_none() + if n: g.db.delete(n) + g.db.flush() if v.client: return c.json(db=g.db)