forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-09-10 03:44:17 +02:00
parent aa05420b8f
commit 2d9f72bc9e
1 changed files with 26 additions and 25 deletions

View File

@ -65,32 +65,33 @@ def notifications(v):
g.db.add(x) g.db.add(x)
i += 1 i += 1
listing = [] if not messages and not posts:
for c in comments: listing = []
c._is_blocked = False for c in comments:
c._is_blocking = False c._is_blocked = False
if c.parent_submission and c.parent_comment and c.parent_comment.author_id == v.id: c._is_blocking = False
c.replies = [] if c.parent_submission and c.parent_comment and c.parent_comment.author_id == v.id:
while c.parent_comment and c.parent_comment.author_id == v.id: c.replies = []
parent = c.parent_comment while c.parent_comment and c.parent_comment.author_id == v.id:
if c not in parent.replies2: parent = c.parent_comment
parent.replies2 = parent.replies2 + [c] if c not in parent.replies2:
parent.replies = parent.replies2 parent.replies2 = parent.replies2 + [c]
c = parent parent.replies = parent.replies2
if c not in listing: c = parent
listing.append(c) if c not in listing:
c.replies = c.replies2 listing.append(c)
elif c.parent_submission: c.replies = c.replies2
c.replies = [] elif c.parent_submission:
if c not in listing: c.replies = []
listing.append(c) if c not in listing:
else: listing.append(c)
if c.parent_comment: else:
while c.level > 1: if c.parent_comment:
c = c.parent_comment while c.level > 1:
c = c.parent_comment
if c not in listing: if c not in listing:
listing.append(c) listing.append(c)
return render_template("notifications.html", return render_template("notifications.html",
v=v, v=v,