remotes/1693045480750635534/spooky-22
Aevann1 2022-03-19 01:21:14 +02:00
parent d06bbe9862
commit 4f283e0764
4 changed files with 14 additions and 13 deletions

View File

@ -440,17 +440,18 @@ def edit_post(pid, v):
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
return {"error":"You have to type more than 280 characters!"}, 403
elif v.bird and len(body) > 140:
return {"error":"You have to type less than 140 characters!"}, 403
if v.id == p.author_id:
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
return {"error":"You have to type more than 280 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 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)
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
p.title = title[:500]
@ -476,7 +477,7 @@ def edit_post(pid, v):
if body != p.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():
for i in poll_regex.finditer(body):
@ -504,7 +505,7 @@ def edit_post(pid, v):
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
bans = filter_comment_html(body_html)
@ -522,7 +523,7 @@ def edit_post(pid, v):
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.ban_reason = "AutoJanny"

View File

@ -249,7 +249,7 @@
<div id="flaggers-{{c.id}}" class="flaggers d-none">
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
<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 %}
<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 %}

View File

@ -656,7 +656,7 @@
<div id="flaggers" class="flaggers d-none">
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
<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 %}
<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 %}

View File

@ -66,7 +66,7 @@
<div id="flaggers-{{p.id}}" class="flaggers d-none">
<strong><i class="far fa-fw fa-flag"></i> Reported by:</strong>
<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 %}
<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 %}
@ -205,7 +205,7 @@
&nbsp;&nbsp;{{p.views}} thread views
</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.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}}