try something else
This commit is contained in:
parent
055c831f8d
commit
27dabf233f
|
@ -1,4 +1,5 @@
|
||||||
import re
|
import re
|
||||||
|
import synapse.spam_checker_api
|
||||||
from synapse.module_api import ModuleApi
|
from synapse.module_api import ModuleApi
|
||||||
|
|
||||||
class AntiSpamRegistrationRegex:
|
class AntiSpamRegistrationRegex:
|
||||||
|
@ -9,11 +10,11 @@ class AntiSpamRegistrationRegex:
|
||||||
check_registration_for_spam=self.check_registration_for_spam,
|
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:
|
for name in self._blocked_usernames:
|
||||||
if name.search(username):
|
if name.search(username):
|
||||||
return self.api.RegistrationBehaviour.DENY # not allowed (spam)
|
return synapse.spam_checker_api.RegistrationBehaviour.DENY # not allowed (spam)
|
||||||
return self.api.RegistrationBehaviour.ALLOW # not spam
|
return synapse.spam_checker_api.RegistrationBehaviour.ALLOW # not spam
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_config(config):
|
def parse_config(config):
|
||||||
|
|
Loading…
Reference in New Issue