diff options
author | Matthew Hodgson <matthew@matrix.org> | 2016-08-20 00:16:18 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2016-08-20 00:16:18 +0100 |
commit | 6e80c03d45c3d09a7e7457f58beff69f14034964 (patch) | |
tree | 06d05072f93e410dbccba1437d7fd5a545c10b86 /synapse/config/appservice.py | |
parent | Explicit join (diff) | |
parent | Merge pull request #1032 from matrix-org/matthew/workerdoc (diff) | |
download | synapse-6e80c03d45c3d09a7e7457f58beff69f14034964.tar.xz |
Merge branch 'develop' into dbkr/notifications_api
Diffstat (limited to 'synapse/config/appservice.py')
-rw-r--r-- | synapse/config/appservice.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/config/appservice.py b/synapse/config/appservice.py index 70d28892c6..dfe43b0b4c 100644 --- a/synapse/config/appservice.py +++ b/synapse/config/appservice.py @@ -123,6 +123,15 @@ def _load_appservice(hostname, as_info, config_filename): raise ValueError( "Missing/bad type 'exclusive' key in %s", regex_obj ) + # protocols check + protocols = as_info.get("protocols") + if protocols: + # Because strings are lists in python + if isinstance(protocols, str) or not isinstance(protocols, list): + raise KeyError("Optional 'protocols' must be a list if present.") + for p in protocols: + if not isinstance(p, str): + raise KeyError("Bad value for 'protocols' item") return ApplicationService( token=as_info["as_token"], url=as_info["url"], @@ -130,4 +139,5 @@ def _load_appservice(hostname, as_info, config_filename): hs_token=as_info["hs_token"], sender=user_id, id=as_info["id"], + protocols=protocols, ) |