From e5dbc9bfdd9aa3ca62d58ee36a08451f0117181c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 30 May 2022 05:26:52 +0200 Subject: [PATCH] made it so ALL comments on ghosted posts are ghosted too, this includes the hidden poll comments that way, the poll voters will be hidden and we can have anonymous polls context: https://rdrama.net/votes?link=t3_2007526 --- files/routes/comments.py | 24 ++++++++++++++---------- files/routes/posts.py | 16 +++++++++++----- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 9b51cf6403..843311b029 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -413,7 +413,8 @@ def api_comment(v): level=level+1, body_html=filter_emojis_only(option), upvotes=0, - is_bot=True + is_bot=True, + ghost=c.ghost ) g.db.add(c_option) @@ -425,7 +426,8 @@ def api_comment(v): level=level+1, body_html=filter_emojis_only(choice), upvotes=0, - is_bot=True + is_bot=True, + ghost=c.ghost ) g.db.add(c_choice) @@ -454,7 +456,7 @@ def api_comment(v): is_bot=True, body_html=body_based_html, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost + ghost=c.ghost ) g.db.add(c_based) @@ -486,7 +488,7 @@ def api_comment(v): is_bot=True, body_html=body_jannied_html, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost + ghost=c.ghost ) g.db.add(c_jannied) @@ -522,7 +524,7 @@ def api_comment(v): is_bot=True, body_html=body_html2, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost + ghost=c.ghost ) g.db.add(c2) @@ -553,7 +555,7 @@ def api_comment(v): is_bot=True, body_html=body_html2, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, + ghost=c.ghost, distinguish_level=6 ) @@ -578,7 +580,7 @@ def api_comment(v): is_bot=True, body_html=body_html2, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, + ghost=c.ghost, distinguish_level=6 ) @@ -596,7 +598,7 @@ def api_comment(v): is_bot=True, body_html=body_html2, top_comment_id=c.top_comment_id, - ghost=parent_post.ghost, + ghost=c.ghost, distinguish_level=6 ) @@ -708,7 +710,8 @@ def edit_comment(cid, v): level=c.level+1, body_html=filter_emojis_only(i.group(1)), upvotes=0, - is_bot=True + is_bot=True, + ghost=c.ghost ) g.db.add(c_option) @@ -720,7 +723,8 @@ def edit_comment(cid, v): level=c.level+1, body_html=filter_emojis_only(i.group(1)), upvotes=0, - is_bot=True + is_bot=True, + ghost=c.ghost ) g.db.add(c_choice) diff --git a/files/routes/posts.py b/files/routes/posts.py index 09062fa490..3daacbaa55 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -483,7 +483,8 @@ def edit_post(pid, v): level=1, body_html=filter_emojis_only(i.group(1)), upvotes=0, - is_bot=True + is_bot=True, + ghost=p.ghost ) g.db.add(c) @@ -494,7 +495,8 @@ def edit_post(pid, v): level=1, body_html=filter_emojis_only(i.group(1)), upvotes=0, - is_bot=True + is_bot=True, + ghost=p.ghost ) g.db.add(c) @@ -1138,7 +1140,8 @@ def submit_post(v, sub=None): level=1, body_html=filter_emojis_only(option), upvotes=0, - is_bot=True + is_bot=True, + ghost=post.ghost ) g.db.add(c) @@ -1148,7 +1151,8 @@ def submit_post(v, sub=None): level=1, body_html=filter_emojis_only(choice), upvotes=0, - is_bot=True + is_bot=True, + ghost=post.ghost ) g.db.add(c) @@ -1227,6 +1231,7 @@ def submit_post(v, sub=None): stickied='AutoJanny', distinguish_level=6, body_html=body_jannied_html, + ghost=post.ghost ) g.db.add(c_jannied) @@ -1329,7 +1334,8 @@ def submit_post(v, sub=None): over_18=False, is_bot=True, app_id=None, - body_html=body_html + body_html=body_html, + ghost=post.ghost ) g.db.add(c)