Merge pull request #246 from matrix-org/dmr/fix-check-username-as-spam

Fix block_usernames config option
This commit is contained in:
David Robertson 2022-03-21 11:54:12 +00:00 committed by GitHub
commit 95d394b964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,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.