Aevann 2023-08-12 22:32:30 +03:00
parent a315aa6a47
commit b99bc05bb3
1 changed files with 9 additions and 4 deletions

View File

@ -64,16 +64,21 @@ def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None):
except: context = 8
comment_info = comment
c = comment
while context and c.level > 1:
c = c.parent_comment
context -= 1
top_comment = c
if post.new: defaultsortingcomments = 'new'
elif v: defaultsortingcomments = v.defaultsortingcomments
else: defaultsortingcomments = "hot"
sort=request.values.get("sort", defaultsortingcomments)
while context and c.level > 1:
parent = c.parent_comment
replies = parent.replies(sort)
replies.remove(c)
parent.replies2 = [c] + replies
c = parent
context -= 1
top_comment = c
if v:
# this is required because otherwise the vote and block
# props won't save properly unless you put them in a list