master
Aevann1 2022-05-25 21:45:03 +02:00
parent c8efa3ade1
commit 94151bf2d6
3 changed files with 18 additions and 9 deletions

View File

@ -185,6 +185,8 @@ def award_post(pid, v):
elif author.unban_utc:
author.unban_utc += 86400
send_repeatable_notification(author.id, f"Your account has been banned for **yet another day** for {link}. Seriously man?")
if request.host == 'rdrama.net' and v.id == CARP_ID:
send_repeatable_notification(AEVANN_ID, link)
elif kind == "unban":
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
@ -202,6 +204,8 @@ def award_post(pid, v):
author.unban_utc = int(time.time()) + 30 * 86400
link = f"[this post]({post.shortlink})"
send_repeatable_notification(author.id, f"Your account has been banned permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass/snow/sand/ass to get unbanned!")
if request.host == 'rdrama.net' and v.id == CARP_ID:
send_repeatable_notification(AEVANN_ID, link)
elif kind == "pin":
if post.stickied and post.stickied_utc:
post.stickied_utc += 3600
@ -429,6 +433,9 @@ def award_comment(cid, v):
elif author.unban_utc:
author.unban_utc += 86400
send_repeatable_notification(author.id, f"Your account has been banned for **yet another day** for {link}. Seriously man?")
if request.host == 'rdrama.net' and v.id == CARP_ID:
send_repeatable_notification(AEVANN_ID, link)
elif kind == "unban":
if not author.is_suspended or not author.unban_utc or time.time() > author.unban_utc: abort(403)
@ -446,6 +453,8 @@ def award_comment(cid, v):
author.unban_utc = int(time.time()) + 30 * 86400
link = f"[this comment]({c.shortlink})"
send_repeatable_notification(author.id, f"Your account has been banned permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass/snow/sand/ass to get unbanned!")
if request.host == 'rdrama.net' and v.id == CARP_ID:
send_repeatable_notification(AEVANN_ID, link)
elif kind == "pin":
if c.is_pinned and c.is_pinned_utc: c.is_pinned_utc += 3600
else:

View File

@ -1366,6 +1366,9 @@ def submit_post(v, sub=None):
post.upvotes += 3
g.db.add(post)
if request.host == 'rdrama.net' and v.id == CARP_ID:
send_repeatable_notification(AEVANN_ID, post.permalink)
g.db.commit()
cache.delete_memoized(frontlist)

View File

@ -118,17 +118,14 @@
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" title="Uses markdown. Limited to 20000 characters."></i></label>
<div>
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea>
<div class="btn btn-secondary fl-r mt-3" onclick="document.getElementById('preview').classList.toggle('d-none');">
Toggle preview
</div>
<div class="text-small font-weight-bold mt-1" id="character-count-submit-text-form" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea>
<div class="btn btn-secondary fl-r mt-3" onclick="document.getElementById('preview').classList.toggle('d-none');">
Toggle preview
</div>
<div class="text-small font-weight-bold mt-1" id="character-count-submit-text-form" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>
<p></p>
<small onclick="makeBold('post-text')" class="btn btn-secondary format d-inline-block m-0">
<i class="fas fa-bold" aria-hidden="true" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Bold"></i>
@ -226,7 +223,7 @@
<script src="/assets/js/marked.js?v=256"></script>
<script src="/assets/js/formatting.js?v=240"></script>
<script src="/assets/js/submit.js?v=255"></script>
<script src="/assets/js/submit.js?v=256"></script>
{% include "emoji_modal.html" %}
{% include "gif_modal.html" %}