diff --git a/files/assets/css/main.css b/files/assets/css/main.css index f840e724c..3a6e8d828 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -2331,6 +2331,12 @@ a.bg-light:hover, a.bg-light:focus, button.bg-light:hover, button.bg-light:focus z-index: 1020; } } +.w-50 { + width: 50% !important; +} +.w-75 { + width: 75% !important; +} .w-100 { width: 100% !important; } @@ -4712,6 +4718,12 @@ ul.comment-section { .rounded-md { border-radius: 0.35rem; } + .w-md-25 { + width: 25% !important; + } + .w-md-100 { + width: 100% !important; + } } @media (min-width: 992px) { .rounded-lg { diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 05e369b38..3bd37bcad 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -516,21 +516,16 @@ def execute_antispam_comment_check(body, v): def execute_under_siege(v, target, body, kind): if v.shadowbanned: return - if not get_setting("under_siege"): return if v.admin_level >= PERMS['BYPASS_UNDER_SIEGE_MODE']: return - if SITE == 'watchpeopledie.tv' and kind == 'normal_comment': + thresholds = cache.get("under_siege_thresholds") + if not thresholds: + thresholds = DEFAULT_UNDER_SIEGE_THRESHOLDS + cache.set("under_siege_thresholds", thresholds) + + if v.age > thresholds[kind] * 60: return - if kind in {'message', 'report'} and SITE == 'rdrama.net': - threshold = 86400 - elif kind != 'message' and SITE == 'watchpeopledie.tv': - threshold = 86400 - else: - threshold = UNDER_SIEGE_AGE_THRESHOLD - - if v.age > threshold: return - unshadowbannedcels = [x[0] for x in g.db.query(ModAction.target_user_id).filter_by(kind='unshadowban')] if v.id in unshadowbannedcels: return diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 4f7a197a7..5888d8eda 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -203,6 +203,7 @@ PERMS = { # Minimum admin_level to perform action. 'MODERATE_PENDING_SUBMITTED_ASSETS': 3, 'UPDATE_ASSETS': 3, 'DELETE_MEDIA': 3, + 'CHANGE_UNDER_SIEGE': 3, 'PROGSTACK': 4, 'UNDO_AWARD_PINS': 4, @@ -533,7 +534,16 @@ PFP_DEFAULT_MARSEY = True NEW_USER_AGE = 7 * 86400 NOTIFICATION_SPAM_AGE_THRESHOLD = 0 COMMENT_SPAM_LENGTH_THRESHOLD = 0 -UNDER_SIEGE_AGE_THRESHOLD = 10 * 60 + +DEFAULT_UNDER_SIEGE_THRESHOLDS = { + "chat": 0, + "normal comment": 0, + "wall comment": 0, + "post": 0, + "report": 0, + "modmail": 0, + "message": 0, +} HOLE_REQUIRED = False HOLE_COST = 0 diff --git a/files/helpers/config/modaction_types.py b/files/helpers/config/modaction_types.py index e91874ad3..1fe379bdf 100644 --- a/files/helpers/config/modaction_types.py +++ b/files/helpers/config/modaction_types.py @@ -46,6 +46,11 @@ MODACTION_TYPES = { "icon": 'fa-lock', "color": 'bg-danger' }, + 'change_under_siege': { + "str": 'changed under siege thresholds', + "icon": 'fa-shield', + "color": 'bg-muted' + }, 'delete_media': { "str": 'deleted media', "icon": 'fa-trash-alt', @@ -91,11 +96,6 @@ MODACTION_TYPES = { "icon": 'fa-shield', "color": 'bg-muted' }, - 'disable_under_siege': { - "str": 'disabled under siege mode', - "icon": 'fa-shield', - "color": 'bg-muted' - }, 'disable_dm_media': { "str": 'disabled DM media', "icon": 'fa-images', @@ -166,11 +166,6 @@ MODACTION_TYPES = { "icon": 'fa-shield', "color": 'bg-success' }, - 'enable_under_siege': { - "str": 'enabled under siege mode', - "icon": 'fa-shield', - "color": 'bg-success', - }, 'enable_dm_media': { "str": 'enabled DM media', "icon": 'fa-images', @@ -442,6 +437,7 @@ MODACTION_PRIVILEGED_TYPES = { 'reset_password', 'schedule_orgy', 'remove_orgy', 'insert_transaction', + 'change_under_siege_thresholds', } MODACTION_PRIVILEGED__TYPES = {'progstack_post', 'progstack_comment', 'unprogstack_post', 'unprogstack_comment'} diff --git a/files/helpers/settings.py b/files/helpers/settings.py index 4cba057b8..8012e80d1 100644 --- a/files/helpers/settings.py +++ b/files/helpers/settings.py @@ -14,7 +14,6 @@ _SETTINGS = { "fart_mode": False, "read_only_mode": False, "offline_mode": False, - "under_siege": False, "dm_media": True, } diff --git a/files/routes/comments.py b/files/routes/comments.py index 1747e8ce4..d3c224d62 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -306,7 +306,7 @@ def comment(v): execute_blackjack(v, c, c.body, "comment") - kind = "normal_comment" if posting_to_post else "wall_comment" + kind = "normal comment" if posting_to_post else "wall comment" execute_under_siege(v, c, c.body, kind) if c.level == 1: c.top_comment_id = c.id diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 721a8d6e0..7135175c1 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -98,6 +98,9 @@ {% if v.admin_level >= PERMS['VIEW_ALT_VOTES'] %}