diff --git a/files/helpers/actions.py b/files/helpers/actions.py index fc11a559d..50956f73f 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -261,6 +261,11 @@ def execute_zozbot(c:Comment, level:int, post_target:post_target_type, v): zozbot.pay_account('coins', 1) g.db.add(zozbot) + if posting_to_submission: + post_target.comment_count += 3 + g.db.add(post_target) + + def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_target_type, v:User): if SITE_NAME != 'rDrama': return posting_to_submission = isinstance(post_target, Submission) @@ -299,6 +304,11 @@ def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_ n = Notification(comment_id=c2.id, user_id=v.id) g.db.add(n) + if posting_to_submission: + post_target.comment_count += 3 + g.db.add(post_target) + + def execute_antispam_submission_check(title, v, url): now = int(time.time()) cutoff = now - 60 * 60 * 24 diff --git a/files/routes/comments.py b/files/routes/comments.py index 459e1bfd4..b7b9e9715 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -292,6 +292,11 @@ def comment(v:User): g.db.add(c_jannied) g.db.flush() + if posting_to_submission: + post_target.comment_count += 1 + g.db.add(post_target) + + n = Notification(comment_id=c_jannied.id, user_id=v.id) g.db.add(n) diff --git a/files/routes/posts.py b/files/routes/posts.py index 009d8bead..54a861009 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -767,6 +767,9 @@ def submit_post(v:User, sub=None): g.db.add(c_jannied) g.db.flush() + post.comment_count += 1 + g.db.add(post) + c_jannied.top_comment_id = c_jannied.id n = Notification(comment_id=c_jannied.id, user_id=v.id)