Allow application services to have an optional 'url'

If 'url' is not specified, they will not be pushed for events or queries. This
is useful for bots who simply wish to reserve large chunks of user/alias
namespace, and don't care about being pushed for events.
This commit is contained in:
Kegan Dougal 2016-08-30 16:21:16 +01:00
parent c7f665d700
commit e82247f990
2 changed files with 17 additions and 0 deletions

View file

@ -132,6 +132,12 @@ def _load_appservice(hostname, as_info, config_filename):
for p in protocols:
if not isinstance(p, str):
raise KeyError("Bad value for 'protocols' item")
if as_info["url"] == "":
logger.info(
"(%s) Explicitly empty 'url' provided. This application service will not receive events or queries.",
config_filename,
)
return ApplicationService(
token=as_info["as_token"],
url=as_info["url"],