mirror of
https://github.com/matrix-org/mjolnir.git
synced 2024-09-28 20:26:02 +00:00
Add an API to filter user directory searches by MXID or display name.
This commit is contained in:
parent
5d8fea07fc
commit
95bb5a7e83
3
.gitignore
vendored
3
.gitignore
vendored
@ -69,3 +69,6 @@ typings/
|
|||||||
|
|
||||||
# next.js build output
|
# next.js build output
|
||||||
.next
|
.next
|
||||||
|
|
||||||
|
# Python packing directories.
|
||||||
|
mjolnir.egg-info/
|
||||||
|
@ -115,6 +115,11 @@ class AntiSpam(object):
|
|||||||
def user_may_publish_room(self, user_id, room_id):
|
def user_may_publish_room(self, user_id, room_id):
|
||||||
return True # allowed
|
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
|
@staticmethod
|
||||||
def parse_config(config):
|
def parse_config(config):
|
||||||
return config # no parsing needed
|
return config # no parsing needed
|
||||||
|
Loading…
Reference in New Issue
Block a user