From b2c011a7ba30b0b67c276f1243dd6873864d6e6a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 30 May 2022 05:01:03 +0200 Subject: [PATCH] Give me a notification whenever one of the other jannies removes a post or comment --- files/routes/admin.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/files/routes/admin.py b/files/routes/admin.py index 1be9d1660..ce92eb64e 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1271,6 +1271,10 @@ def ban_post(post_id, v): v.coins += 1 g.db.add(v) + if SITE == 'rdrama.net' and v.id != AEVANN_ID: + message = f"@{v.username} has removed [{post.title}]({post.shortlink})" + send_repeatable_notification(AEVANN_ID, message) + requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, json={'files': [f"{SITE_FULL}/logged_out/"]}, timeout=5) g.db.commit() @@ -1473,6 +1477,11 @@ def api_ban_comment(c_id, v): target_comment_id=comment.id, ) g.db.add(ma) + + if SITE == 'rdrama.net' and v.id != AEVANN_ID: + message = f"@{v.username} has removed [comment]({comment.shortlink})" + send_repeatable_notification(AEVANN_ID, message) + g.db.commit() return {"message": "Comment removed!"}