try something else

master
Joe 3 months ago
parent 055c831f8d
commit 27dabf233f
Signed by: joe
GPG Key ID: 8595A3F8F2CE1B74
  1. 7
      synapse_simple_antispam/registration.py

@ -1,4 +1,5 @@
import re
import synapse.spam_checker_api
from synapse.module_api import ModuleApi
class AntiSpamRegistrationRegex:
@ -9,11 +10,11 @@ class AntiSpamRegistrationRegex:
check_registration_for_spam=self.check_registration_for_spam,
)
async def check_registration_for_spam(self, email_threepid, username, request_info, auth_provider_id) -> "self.api.RegistrationBehaviour":
async def check_registration_for_spam(self, email_threepid, username, request_info, auth_provider_id) -> "synapse.spam_checker_api.RegistrationBehaviour":
for name in self._blocked_usernames:
if name.search(username):
return self.api.RegistrationBehaviour.DENY # not allowed (spam)
return self.api.RegistrationBehaviour.ALLOW # not spam
return synapse.spam_checker_api.RegistrationBehaviour.DENY # not allowed (spam)
return synapse.spam_checker_api.RegistrationBehaviour.ALLOW # not spam
@staticmethod
def parse_config(config):

Loading…
Cancel
Save