From f37314964f16d6127151049a63c279e1b0a53366 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 4 Apr 2022 00:32:10 +0200 Subject: [PATCH] sfd --- files/routes/front.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 360efb41d2..46e8b6ef9c 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -89,19 +89,12 @@ def notifications(v): next_exists = (len(notifications) > len(listing)) else: - all = [x.comment_id for x in v.notifications.join(Notification.comment).filter( + notifications = v.notifications.join(Notification.comment).filter( Comment.is_banned == False, Comment.deleted_utc == 0, Comment.author_id != AUTOJANNY_ID, Comment.body_html.notlike('

New rdrama mention: 50) notifications = notifications[:50] @@ -123,10 +116,20 @@ def notifications(v): listing = [] for c in comments: if c.parent_submission: + + if c.replies2 == None: c.replies2 = [] + for x in c.child_comments: + if x.author_id == v.id: + x.voted = 1 + if x not in c.replies2: c.replies2.append(x) + while c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment in comments): - c = c.parent_comment - c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] - c.replies2 = [x for x in c.child_comments if c.author_id == v.id or x.id in all] + parent = c.parent_comment + if parent.replies2 == None: parent.replies2 = [c] + elif c not in parent.replies2: parent.replies2.append(c) + c = parent + + if c.replies2 == None: c.replies2 = [] else: while c.parent_comment: c = c.parent_comment