forked from rDrama/rDrama
fds
parent
d06bbe9862
commit
4f283e0764
|
@ -440,17 +440,18 @@ def edit_post(pid, v):
|
||||||
|
|
||||||
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
|
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
|
||||||
|
|
||||||
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
if v.id == p.author_id:
|
||||||
return {"error":"You have to type more than 280 characters!"}, 403
|
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
|
||||||
elif v.bird and len(body) > 140:
|
return {"error":"You have to type more than 280 characters!"}, 403
|
||||||
return {"error":"You have to type less than 140 characters!"}, 403
|
elif v.bird and len(body) > 140:
|
||||||
|
return {"error":"You have to type less than 140 characters!"}, 403
|
||||||
|
|
||||||
if title != p.title:
|
if title != p.title:
|
||||||
if v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
|
if v.id == p.author_id and v.agendaposter and not v.marseyawarded: title = torture_ap(title, v.username)
|
||||||
|
|
||||||
title_html = filter_emojis_only(title, edit=True)
|
title_html = filter_emojis_only(title, edit=True)
|
||||||
|
|
||||||
if v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html):
|
if v.id == p.author_id and v.marseyawarded and not marseyaward_title_regex.fullmatch(title_html):
|
||||||
return {"error":"You can only type marseys!"}, 403
|
return {"error":"You can only type marseys!"}, 403
|
||||||
|
|
||||||
p.title = title[:500]
|
p.title = title[:500]
|
||||||
|
@ -476,7 +477,7 @@ def edit_post(pid, v):
|
||||||
if body != p.body:
|
if body != p.body:
|
||||||
body = image_regex.sub(r'![](\1)', body)
|
body = image_regex.sub(r'![](\1)', body)
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
|
if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
|
||||||
|
|
||||||
if not p.options.count():
|
if not p.options.count():
|
||||||
for i in poll_regex.finditer(body):
|
for i in poll_regex.finditer(body):
|
||||||
|
@ -504,7 +505,7 @@ def edit_post(pid, v):
|
||||||
|
|
||||||
body_html = sanitize(body, edit=True)
|
body_html = sanitize(body, edit=True)
|
||||||
|
|
||||||
if v.marseyawarded and marseyaward_body_regex.search(body_html):
|
if v.id == p.author_id and v.marseyawarded and marseyaward_body_regex.search(body_html):
|
||||||
return {"error":"You can only type marseys!"}, 403
|
return {"error":"You can only type marseys!"}, 403
|
||||||
|
|
||||||
bans = filter_comment_html(body_html)
|
bans = filter_comment_html(body_html)
|
||||||
|
@ -522,7 +523,7 @@ def edit_post(pid, v):
|
||||||
|
|
||||||
p.body_html = body_html
|
p.body_html = body_html
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{p.body}{p.title}'.lower():
|
if v.id == p.author_id and v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{p.body}{p.title}'.lower():
|
||||||
|
|
||||||
p.is_banned = True
|
p.is_banned = True
|
||||||
p.ban_reason = "AutoJanny"
|
p.ban_reason = "AutoJanny"
|
||||||
|
|
|
@ -249,7 +249,7 @@
|
||||||
<div id="flaggers-{{c.id}}" class="flaggers d-none">
|
<div id="flaggers-{{c.id}}" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in c.flags %}
|
{% for f in c.flags %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/comment/{{f.comment_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/comment/{{f.comment_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -656,7 +656,7 @@
|
||||||
<div id="flaggers" class="flaggers d-none">
|
<div id="flaggers" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in p.flags %}
|
{% for f in p.flags %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<div id="flaggers-{{p.id}}" class="flaggers d-none">
|
<div id="flaggers-{{p.id}}" class="flaggers d-none">
|
||||||
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
<ul style="padding-left:20px; margin-bottom: 0;">
|
<ul style="padding-left:20px; margin-bottom: 0;word-wrap:break-word">
|
||||||
{% for f in p.flags %}
|
{% for f in p.flags %}
|
||||||
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
<li><a style="font-weight:bold" href="{{f.user.url}}">{{f.user.username}}</a>{% if f.reason %}: {{f.realreason(v) | safe}}{% endif %} {% if v and v.admin_level > 1 %}<a role="button" onclick="post_toast(this,'/del_report/post/{{f.post_id}}/{{f.user_id}}')">[remove]</a>{% endif %}</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -205,7 +205,7 @@
|
||||||
{{p.views}} thread views
|
{{p.views}} thread views
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if voted %}visited{% endif %} stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="{% if voted and v.id == AEVANN_ID and p.author_id != PIZZASHILL_ID %}visited{% endif %} stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||||
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
{% if p.club %}<span class="patron font-weight-bolder mr-1" style="background-color:red; font-size:12px; line-height:2;">{{CC}}</span>{% endif %}
|
||||||
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
{% if p.flair %}<span class="patron font-weight-bolder mr-1" style="background-color:var(--primary); font-size:12px; line-height:2;">{{p.flair | safe}}</span>{% endif %}
|
||||||
{{p.realtitle(v) | safe}}
|
{{p.realtitle(v) | safe}}
|
||||||
|
|
Loading…
Reference in New Issue