make sure autojanny, zozbot, longpostbot add to the comment count of a post
parent
104060e79a
commit
81cc869fe2
|
@ -261,6 +261,11 @@ def execute_zozbot(c:Comment, level:int, post_target:post_target_type, v):
|
||||||
zozbot.pay_account('coins', 1)
|
zozbot.pay_account('coins', 1)
|
||||||
g.db.add(zozbot)
|
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):
|
def execute_longpostbot(c:Comment, level:int, body, body_html, post_target:post_target_type, v:User):
|
||||||
if SITE_NAME != 'rDrama': return
|
if SITE_NAME != 'rDrama': return
|
||||||
posting_to_submission = isinstance(post_target, Submission)
|
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)
|
n = Notification(comment_id=c2.id, user_id=v.id)
|
||||||
g.db.add(n)
|
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):
|
def execute_antispam_submission_check(title, v, url):
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
cutoff = now - 60 * 60 * 24
|
cutoff = now - 60 * 60 * 24
|
||||||
|
|
|
@ -292,6 +292,11 @@ def comment(v:User):
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
g.db.flush()
|
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)
|
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
|
|
|
@ -767,6 +767,9 @@ def submit_post(v:User, sub=None):
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
post.comment_count += 1
|
||||||
|
g.db.add(post)
|
||||||
|
|
||||||
c_jannied.top_comment_id = c_jannied.id
|
c_jannied.top_comment_id = c_jannied.id
|
||||||
|
|
||||||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||||
|
|
Loading…
Reference in New Issue