Add an API to filter user directory searches by MXID or display name.

This commit is contained in:
Patrick Cloke 2020-02-11 10:10:27 -05:00
parent 5d8fea07fc
commit 95bb5a7e83
2 changed files with 8 additions and 0 deletions

3
.gitignore vendored
View File

@ -69,3 +69,6 @@ typings/
# next.js build output
.next
# Python packing directories.
mjolnir.egg-info/

View File

@ -115,6 +115,11 @@ class AntiSpam(object):
def user_may_publish_room(self, user_id, room_id):
return True # allowed
def check_for_banned_user(self, user_id, display_name):
# Check whether the user ID or display name matches any of the banned
# patterns.
return self.is_user_banned(user_id) or self.is_user_banned(display_name)
@staticmethod
def parse_config(config):
return config # no parsing needed