From c58872e3c6c5ceba33c28b70b5b019539f8b987f Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 11 Mar 2023 11:12:16 +0200 Subject: [PATCH] same as last commit --- files/routes/notifications.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/routes/notifications.py b/files/routes/notifications.py index a8d472709..dde238529 100644 --- a/files/routes/notifications.py +++ b/files/routes/notifications.py @@ -352,6 +352,10 @@ def notifications(v:User): x.replies2 = g.db.query(Comment).filter_by(parent_comment_id=x.id).filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).order_by(Comment.id.desc()).all() total.extend(x.replies2) + if not hasattr(c, "notified_utc") or n.created_utc > c.notified_utc: + c.notified_utc = n.created_utc + c.collapse = n.read + c.replies2 = sorted(c.replies2, key=lambda x: x.notified_utc if hasattr(x, "notified_utc") else x.id, reverse=True) else: while c.parent_comment_id: