Aevann 2023-08-14 22:57:24 +03:00
parent 6a367b186e
commit 48da547fb8
1 changed files with 8 additions and 5 deletions

View File

@ -45,16 +45,19 @@ def _mark_comment_as_read(cid, vid):
def post_pid_comment_cid(cid, v, pid=None, anything=None, sub=None):
comment = get_comment(cid, v=v)
if comment.parent_post:
post = comment.parent_post
elif comment.wall_user_id:
return redirect(f"/id/{comment.wall_user_id}/wall/comment/{comment.id}")
else:
post = NOTIFICATION_THREAD
if not User.can_see(v, comment): abort(403)
if v and request.values.get("read"):
gevent.spawn(_mark_comment_as_read, comment.id, v.id)
if comment.parent_post:
post = comment.parent_post
else:
post = NOTIFICATION_THREAD
post = get_post(post, v=v)
if not (v and v.client) and post.over_18 and not (v and v.over_18) and not session.get('over_18_cookies', 0) >= int(time.time()):