From 0539609d61117eae50b007ae8d48f6a6aa7b3a53 Mon Sep 17 00:00:00 2001 From: TLSM Date: Fri, 29 Jul 2022 15:55:12 -0400 Subject: [PATCH] Restrict abuse from young accounts. --- files/helpers/alerts.py | 4 ++++ files/helpers/const.py | 1 + 2 files changed, 5 insertions(+) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 85bacff58a..dd32c49f5d 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -88,6 +88,10 @@ def add_notif(cid, uid): def NOTIFY_USERS(text, v): + # Restrict young accounts from generating notifications + if v.age < NOTIFICATION_SPAM_AGE_THRESHOLD: + return set() + notify_users = set() for word, id in NOTIFIED_USERS.items(): if id == 0 or v.id == id: continue diff --git a/files/helpers/const.py b/files/helpers/const.py index e38e3f0caa..c6757aa5b0 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -168,6 +168,7 @@ PIN_LIMIT = 3 POST_RATE_LIMIT = '1/second;2/minute;10/hour;50/day' LOGGEDIN_ACTIVE_TIME = 15 * 60 PFP_DEFAULT_MARSEY = True +NOTIFICATION_SPAM_AGE_THRESHOLD = 3 * 86400 HOLE_NAME = 'hole' HOLE_STYLE_FLAIR = False