Add an option to disable search for homeservers which may not be interested in it (#4230)

This is useful for homeservers not intended for users, such as bot-only homeservers or ones that only process IoT data.
This commit is contained in:
Travis Ralston 2018-12-04 04:01:02 -07:00 committed by Richard van der Hoff
parent 512e94d230
commit 158ffb92f1
4 changed files with 21 additions and 1 deletions

View file

@ -50,6 +50,9 @@ class SearchHandler(BaseHandler):
dict to be returned to the client with results of search
"""
if not self.hs.config.enable_search:
raise SynapseError(400, "Search is disabled on this homeserver")
batch_group = None
batch_group_key = None
batch_token = None