forked from rDrama/rDrama
revert all notification commits made today
parent
691a025db8
commit
1623ec93c7
|
@ -307,7 +307,7 @@ def notifications(v:User):
|
||||||
cids = [x[0].id for x in comments]
|
cids = [x[0].id for x in comments]
|
||||||
|
|
||||||
listing = []
|
listing = []
|
||||||
total = [x[0] for x in comments]
|
total = []
|
||||||
for c, n in comments:
|
for c, n in comments:
|
||||||
if n.created_utc > 1620391248: c.notif_utc = n.created_utc
|
if n.created_utc > 1620391248: c.notif_utc = n.created_utc
|
||||||
if not n.read:
|
if not n.read:
|
||||||
|
@ -321,10 +321,10 @@ def notifications(v:User):
|
||||||
total.extend(c.replies2)
|
total.extend(c.replies2)
|
||||||
for x in c.replies2:
|
for x in c.replies2:
|
||||||
if x.replies2 == None: x.replies2 = []
|
if x.replies2 == None: x.replies2 = []
|
||||||
|
count = 0
|
||||||
def process(c):
|
while count < 50 and c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids):
|
||||||
|
count += 1
|
||||||
c = c.parent_comment
|
c = c.parent_comment
|
||||||
total.append(c)
|
|
||||||
if c.replies2 == None:
|
if c.replies2 == None:
|
||||||
c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).order_by(Comment.id.desc()).all()
|
c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).filter(or_(Comment.author_id == v.id, Comment.id.in_(cids))).order_by(Comment.id.desc()).all()
|
||||||
total.extend(c.replies2)
|
total.extend(c.replies2)
|
||||||
|
@ -332,19 +332,11 @@ def notifications(v:User):
|
||||||
if x.replies2 == None:
|
if x.replies2 == None:
|
||||||
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()
|
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)
|
total.extend(x.replies2)
|
||||||
|
|
||||||
count = 0
|
|
||||||
while count < 50 and c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids):
|
|
||||||
count += 1
|
|
||||||
process(c)
|
|
||||||
|
|
||||||
if count == 0 and c.parent_comment and c.parent_comment not in total:
|
|
||||||
process(c)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
while c.parent_comment:
|
while c.parent_comment:
|
||||||
c = c.parent_comment
|
c = c.parent_comment
|
||||||
c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).order_by(Comment.id).all()
|
c.replies2 = g.db.query(Comment).filter_by(parent_comment_id=c.id).order_by(Comment.id).all()
|
||||||
|
total.extend(c.replies2)
|
||||||
|
|
||||||
if c not in listing: listing.append(c)
|
if c not in listing: listing.append(c)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue