From ef9d5fc5704fd557e661baf5903a80f3dec191b2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Nov 2022 16:04:17 +0000 Subject: [PATCH] Block reasons on hashtags --- daemon.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/daemon.py b/daemon.py index fed0c0315..77e9d1a3f 100644 --- a/daemon.py +++ b/daemon.py @@ -2638,6 +2638,9 @@ class PubServer(BaseHTTPRequestHandler): full_block_domain = \ moderation_domain.strip() if full_block_domain or nickname.startswith('#'): + if nickname.startswith('#') and ' ' in nickname: + nickname = nickname.split(' ')[0] + moderation_reason = nickname.split(' ', 1)[0] add_global_block(base_dir, nickname, full_block_domain, moderation_reason) if moderation_button == 'unblock': @@ -2664,6 +2667,8 @@ class PubServer(BaseHTTPRequestHandler): nickname = '*' full_block_domain = moderation_domain.strip() if full_block_domain or nickname.startswith('#'): + if nickname.startswith('#') and ' ' in nickname: + nickname = nickname.split(' ')[0] remove_global_block(base_dir, nickname, full_block_domain) if moderation_button == 'remove':