make sure autojanny, zozbot, longpostbot add to the comment count of a post

pull/127/head
Aevann 2023-02-18 23:59:17 +02:00
parent 104060e79a
commit 81cc869fe2
3 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)