master
Aevann1 2022-04-04 01:32:42 +02:00
parent f3a3729f14
commit 5540d82ce1
1 changed files with 4 additions and 4 deletions

View File

@ -103,11 +103,11 @@ def notifications(v):
g.db.commit()
all = set(x[0] for x in g.db.query(Notification.comment_id).join(Comment, Notification.comment_id == Comment.id).filter(Comment.is_banned == False,
all = g.db.query(Comment).join(Notification, Notification.comment_id == Comment.id).filter(Comment.is_banned == False,
Comment.deleted_utc == 0,
Comment.author_id != AUTOJANNY_ID,
Comment.body_html.notlike('<html><body><p>New rdrama mention: <a href="https://old.reddit.com/r/%')
).order_by(Comment.top_comment_id.desc()).offset(50 * (page - 1)).limit(100).all())
).order_by(Comment.top_comment_id.desc()).offset(50 * (page - 1)).limit(100).all()
comments = g.db.query(Comment).join(Notification).distinct(Comment.top_comment_id).filter(
Notification.user_id == v.id,
@ -124,11 +124,11 @@ def notifications(v):
listing = []
for c in comments:
if c.parent_submission:
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 all if x.parent_comment_id == c.id]
cids = cids | set(x.id for x in c.replies2)
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 all if x.parent_comment_id == c.id]
cids = cids | set(x.id for x in c.replies2)
cids.add(c.id)
else: