summary refs log tree commit diff
path: root/synapse/appservice/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-05-18 16:51:18 +0100
committerGitHub <noreply@github.com>2017-05-18 16:51:18 +0100
commit234772db6dc99665803b29e199498292c37a6c03 (patch)
tree0905b0c2d5eaf87c06b84fbe9a31385ab545b88a /synapse/appservice/__init__.py
parentRemove size of push get_rules cache (diff)
parentMake get_if_app_services_interested_in_user faster (diff)
downloadsynapse-234772db6dc99665803b29e199498292c37a6c03.tar.xz
Merge pull request #2233 from matrix-org/erikj/faster_as_check
Make get_if_app_services_interested_in_user faster
Diffstat (limited to 'synapse/appservice/__init__.py')
-rw-r--r--synapse/appservice/__init__.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index 7346206bb1..b989007314 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -241,6 +241,16 @@ class ApplicationService(object):
     def is_exclusive_room(self, room_id):
         return self._is_exclusive(ApplicationService.NS_ROOMS, room_id)
 
+    def get_exlusive_user_regexes(self):
+        """Get the list of regexes used to determine if a user is exclusively
+        registered by the AS
+        """
+        return [
+            regex_obj["regex"]
+            for regex_obj in self.namespaces[ApplicationService.NS_USERS]
+            if regex_obj["exclusive"]
+        ]
+
     def is_rate_limited(self):
         return self.rate_limited