From 2c9fc0ccdcf026ee1bf12498cfeb6f8c2236dbdc Mon Sep 17 00:00:00 2001 From: David Robertson Date: Thu, 17 Mar 2022 16:53:31 +0000 Subject: [PATCH] Fix block_usernames config option Fixes #244. --- synapse_antispam/mjolnir/antispam.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/synapse_antispam/mjolnir/antispam.py b/synapse_antispam/mjolnir/antispam.py index 751c070..1cac114 100644 --- a/synapse_antispam/mjolnir/antispam.py +++ b/synapse_antispam/mjolnir/antispam.py @@ -121,7 +121,9 @@ class AntiSpam(object): def check_username_for_spam(self, user_profile): if not self.block_usernames: - return True # allowed (we aren't blocking based on usernames) + # /!\ NB: unlike other checks, where `True` means allowed, + # here `True` means "this user is a spammer". + return False # allowed (we aren't blocking based on usernames) # Check whether the user ID or display name matches any of the banned # patterns.