summary refs log tree commit diff
path: root/synapse/appservice
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-05-18 16:34:41 +0100
committerErik Johnston <erik@matrix.org>2017-05-18 16:34:44 +0100
commit760625acbaef9ae7032ba5e59e91979f454febef (patch)
tree0905b0c2d5eaf87c06b84fbe9a31385ab545b88a /synapse/appservice
parentRemove size of push get_rules cache (diff)
downloadsynapse-760625acbaef9ae7032ba5e59e91979f454febef.tar.xz
Make get_if_app_services_interested_in_user faster
Diffstat (limited to 'synapse/appservice')
-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