summary refs log tree commit diff
path: root/synapse/appservice/__init__.py
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-08-20 00:16:18 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-08-20 00:16:18 +0100
commit6e80c03d45c3d09a7e7457f58beff69f14034964 (patch)
tree06d05072f93e410dbccba1437d7fd5a545c10b86 /synapse/appservice/__init__.py
parentExplicit join (diff)
parentMerge pull request #1032 from matrix-org/matthew/workerdoc (diff)
downloadsynapse-6e80c03d45c3d09a7e7457f58beff69f14034964.tar.xz
Merge branch 'develop' into dbkr/notifications_api
Diffstat (limited to 'synapse/appservice/__init__.py')
-rw-r--r--synapse/appservice/__init__.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index b1b91d0a55..bde9b51b2e 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -81,13 +81,17 @@ class ApplicationService(object):
     NS_LIST = [NS_USERS, NS_ALIASES, NS_ROOMS]
 
     def __init__(self, token, url=None, namespaces=None, hs_token=None,
-                 sender=None, id=None):
+                 sender=None, id=None, protocols=None):
         self.token = token
         self.url = url
         self.hs_token = hs_token
         self.sender = sender
         self.namespaces = self._check_namespaces(namespaces)
         self.id = id
+        if protocols:
+            self.protocols = set(protocols)
+        else:
+            self.protocols = set()
 
     def _check_namespaces(self, namespaces):
         # Sanity check that it is of the form:
@@ -219,6 +223,9 @@ class ApplicationService(object):
             or user_id == self.sender
         )
 
+    def is_interested_in_protocol(self, protocol):
+        return protocol in self.protocols
+
     def is_exclusive_alias(self, alias):
         return self._is_exclusive(ApplicationService.NS_ALIASES, alias)