forked from rDrama/rDrama
rename ADMIGGER variable to ADMIGGER_THREADS for clarity
parent
aec5f96a7b
commit
62d3738e46
|
@ -1221,7 +1221,7 @@ if path.isfile(f'snappy_{SITE_NAME}.txt'):
|
||||||
with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f:
|
with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f:
|
||||||
SNAPPY_QUOTES = f.read().split("\n{[para]}\n")
|
SNAPPY_QUOTES = f.read().split("\n{[para]}\n")
|
||||||
|
|
||||||
ADMIGGERS = {SIDEBAR_THREAD, BANNER_THREAD, BADGE_THREAD, SNAPPY_THREAD}
|
ADMIGGER_THREADS = {SIDEBAR_THREAD, BANNER_THREAD, BADGE_THREAD, SNAPPY_THREAD}
|
||||||
|
|
||||||
proxies = {"http":PROXY_URL,"https":PROXY_URL}
|
proxies = {"http":PROXY_URL,"https":PROXY_URL}
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ def comment(v):
|
||||||
|
|
||||||
body = sanitize_raw_body(request.values.get("body", ""), False)
|
body = sanitize_raw_body(request.values.get("body", ""), False)
|
||||||
|
|
||||||
if parent_post.id not in ADMIGGERS:
|
if parent_post.id not in ADMIGGER_THREADS:
|
||||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
||||||
abort(403, "You have to type more than 280 characters!")
|
abort(403, "You have to type more than 280 characters!")
|
||||||
elif v.bird and len(body) > 140:
|
elif v.bird and len(body) > 140:
|
||||||
|
@ -200,12 +200,12 @@ def comment(v):
|
||||||
if v.marsify:
|
if v.marsify:
|
||||||
body_for_sanitize = marsify(body_for_sanitize)
|
body_for_sanitize = marsify(body_for_sanitize)
|
||||||
|
|
||||||
torture = (v.agendaposter and not v.marseyawarded and parent_post.sub != 'chudrama' and parent_post.id not in ADMIGGERS)
|
torture = (v.agendaposter and not v.marseyawarded and parent_post.sub != 'chudrama' and parent_post.id not in ADMIGGER_THREADS)
|
||||||
|
|
||||||
body_html = sanitize(body_for_sanitize, limit_pings=5, count_marseys=not v.marsify, torture=torture)
|
body_html = sanitize(body_for_sanitize, limit_pings=5, count_marseys=not v.marsify, torture=torture)
|
||||||
|
|
||||||
|
|
||||||
if parent_post.id not in ADMIGGERS and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower():
|
if parent_post.id not in ADMIGGER_THREADS and '!wordle' not in body.lower() and AGENDAPOSTER_PHRASE not in body.lower():
|
||||||
existing = g.db.query(Comment.id).filter(Comment.author_id == v.id,
|
existing = g.db.query(Comment.id).filter(Comment.author_id == v.id,
|
||||||
Comment.deleted_utc == 0,
|
Comment.deleted_utc == 0,
|
||||||
Comment.parent_comment_id == parent_comment_id,
|
Comment.parent_comment_id == parent_comment_id,
|
||||||
|
@ -265,7 +265,7 @@ def comment(v):
|
||||||
if SITE == 'pcmemes.net' and c.body.lower().startswith("based"):
|
if SITE == 'pcmemes.net' and c.body.lower().startswith("based"):
|
||||||
execute_basedbot(c, level, body, parent_submission, parent_post, v)
|
execute_basedbot(c, level, body, parent_submission, parent_post, v)
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and parent_post.sub != 'chudrama':
|
if post.id not in ADMIGGER_THREADS and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and parent_post.sub != 'chudrama':
|
||||||
c.is_banned = True
|
c.is_banned = True
|
||||||
c.ban_reason = "AutoJanny"
|
c.ban_reason = "AutoJanny"
|
||||||
g.db.add(c)
|
g.db.add(c)
|
||||||
|
@ -346,7 +346,7 @@ def comment(v):
|
||||||
|
|
||||||
execute_pizza_autovote(v, c)
|
execute_pizza_autovote(v, c)
|
||||||
|
|
||||||
if v.marseyawarded and parent_post.id not in ADMIGGERS and marseyaward_body_regex.search(body_html):
|
if v.marseyawarded and parent_post.id not in ADMIGGER_THREADS and marseyaward_body_regex.search(body_html):
|
||||||
abort(403, "You can only type marseys!")
|
abort(403, "You can only type marseys!")
|
||||||
|
|
||||||
check_for_treasure(body, c)
|
check_for_treasure(body, c)
|
||||||
|
@ -462,7 +462,7 @@ def edit_comment(cid, v):
|
||||||
|
|
||||||
execute_blackjack(v, c, c.body, "comment")
|
execute_blackjack(v, c, c.body, "comment")
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama':
|
if post.id not in ADMIGGER_THREADS and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in c.body.lower() and c.post.sub != 'chudrama':
|
||||||
abort(403, f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!')
|
abort(403, f'You have to include "{AGENDAPOSTER_PHRASE}" in your comment!')
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -970,7 +970,7 @@
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input type="hidden" name="parent_fullname" value="p_{{p.id}}">
|
<input type="hidden" name="parent_fullname" value="p_{{p.id}}">
|
||||||
<input autocomplete="off" id="reply-form-submission-{{p.fullname}}" type="hidden" name="submission" value="{{p.id}}">
|
<input autocomplete="off" id="reply-form-submission-{{p.fullname}}" type="hidden" name="submission" value="{{p.id}}">
|
||||||
<textarea required autocomplete="off" {% if not (p and p.id in ADMIGGERS) %}{% if v.longpost %}minlength="280"{% elif v.bird %}maxlength="140"{% endif %}{% endif %} minlength="1" maxlength="10000" data-preview="form-preview-{{p.fullname}}" oninput="markdown(this);charLimit('reply-form-body-{{p.fullname}}','charcount-reply')" id="reply-form-body-{{p.fullname}}" data-fullname="{{p.fullname}}" class="comment-box form-control rounded" name="body" form="reply-to-{{p.fullname}}" aria-label="With textarea" placeholder="Add your comment..." rows="3"></textarea>
|
<textarea required autocomplete="off" {% if not (p and p.id in ADMIGGER_THREADS) %}{% if v.longpost %}minlength="280"{% elif v.bird %}maxlength="140"{% endif %}{% endif %} minlength="1" maxlength="10000" data-preview="form-preview-{{p.fullname}}" oninput="markdown(this);charLimit('reply-form-body-{{p.fullname}}','charcount-reply')" id="reply-form-body-{{p.fullname}}" data-fullname="{{p.fullname}}" class="comment-box form-control rounded" name="body" form="reply-to-{{p.fullname}}" aria-label="With textarea" placeholder="Add your comment..." rows="3"></textarea>
|
||||||
|
|
||||||
<div class="text-small font-weight-bold mt-1" id="charcount-reply" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>
|
<div class="text-small font-weight-bold mt-1" id="charcount-reply" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue