forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2022-02-01 09:25:20 +02:00
parent 4e82789417
commit 5808c060cb
1 changed files with 13 additions and 12 deletions

View File

@ -92,6 +92,7 @@ def notifications(v):
replies = [] replies = []
for x in c.replies: for x in c.replies:
if x.id not in all and x.author_id == v.id: if x.id not in all and x.author_id == v.id:
x.voted = 1
replies.append(x) replies.append(x)
all.add(x.id) all.add(x.id)
c.replies = replies c.replies = replies
@ -99,23 +100,23 @@ def notifications(v):
parent = c.parent_comment parent = c.parent_comment
if c not in parent.replies2: if c not in parent.replies2:
parent.replies2 = parent.replies2 + [c] parent.replies2 = parent.replies2 + [c]
all.add(c.id)
parent.replies = parent.replies2 parent.replies = parent.replies2
c = parent c = parent
if c.id not in all and c not in listing: if c.id not in all and c not in listing:
listing.append(c)
all.add(c.id) all.add(c.id)
listing.append(c)
c.replies = c.replies2 c.replies = c.replies2
elif c.parent_submission: elif c.parent_submission:
if c.id not in all and c not in listing: replies = []
listing.append(c) for x in c.replies:
if x.id not in all and x.author_id == v.id:
x.voted = 1
replies.append(x)
all.add(x.id)
c.replies = replies
if x.id not in all and c not in listing:
all.add(c.id) all.add(c.id)
replies = [] listing.append(c)
for x in c.replies:
if x.id not in all and x.author_id == v.id:
replies.append(x)
all.add(x.id)
c.replies = replies
else: else:
if c.parent_comment: if c.parent_comment:
while c.level > 1: while c.level > 1:
@ -123,10 +124,10 @@ def notifications(v):
c = c.parent_comment c = c.parent_comment
if c.id not in all and c not in listing: if c.id not in all and c not in listing:
listing.append(c)
all.add(c.id) all.add(c.id)
listing.append(c)
comments = get_comments(list(all), v=v) comments = get_comments(all, v=v)
if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} if request.headers.get("Authorization"): return {"data":[x.json for x in listing]}