remotes/1693045480750635534/spooky-22
Aevann1 2021-08-08 01:14:32 +02:00
parent 738e4bfdb5
commit b4a1fce122
1 changed files with 6 additions and 4 deletions

View File

@ -58,14 +58,16 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
# context improver
try: context = int(request.args.get("context", 0))
except: context = 0
comment_info = comment
while context > 0 and comment.level > 1:
parent = get_comment(c.parent_comment_id, v=v)
post.preloaded_comments += [parent]
c = parent
comment = parent
context -= 1
top_comment = comment
if v: defaultsortingcomments = v.defaultsortingcomments
else: defaultsortingcomments = "top"
@ -168,10 +170,10 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
post.tree_comments()
post.replies=[comment]
post.replies=[top_comment]
if request.headers.get("Authorization"): return comment.json
else: return post.rendered_page(v=v, sort=sort, comment=comment, comment_info=comment)
if request.headers.get("Authorization"): return top_comment.json
else: return post.rendered_page(v=v, sort=sort, comment=top_comment, comment_info=comment_info)
@app.post("/comment")