forked from rDrama/rDrama
Restore mistakenly removed commenting logic.
parent
92a2224b91
commit
77ed5728c4
|
@ -325,6 +325,11 @@ def comment(v):
|
||||||
g.db.add(c)
|
g.db.add(c)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
||||||
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
||||||
|
g.db.add(notif)
|
||||||
|
|
||||||
if c.level == 1: c.top_comment_id = c.id
|
if c.level == 1: c.top_comment_id = c.id
|
||||||
else: c.top_comment_id = parent.top_comment_id
|
else: c.top_comment_id = parent.top_comment_id
|
||||||
|
|
||||||
|
@ -684,6 +689,14 @@ def edit_comment(cid, v):
|
||||||
c.body = body[:10000]
|
c.body = body[:10000]
|
||||||
c.body_html = body_html
|
c.body_html = body_html
|
||||||
|
|
||||||
|
if blackjack and any(i in c.body.lower() for i in blackjack.split()):
|
||||||
|
v.shadowbanned = 'AutoJanny'
|
||||||
|
g.db.add(v)
|
||||||
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=CARP_ID).one_or_none()
|
||||||
|
if not notif:
|
||||||
|
notif = Notification(comment_id=c.id, user_id=CARP_ID)
|
||||||
|
g.db.add(notif)
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama':
|
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama':
|
||||||
return {"error": f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!'}, 403
|
return {"error": f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!'}, 403
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue