summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-19 16:01:05 +0000
committerErik Johnston <erik@matrix.org>2016-01-19 16:01:05 +0000
commit5a7d1ecffcab7a94caf70471a2eec56eb868573c (patch)
treebfe7fb4d0529969d70ad02ccb103d1343a7d6224 /synapse/server.py
parentHandle glob -> regex errors (diff)
downloadsynapse-5a7d1ecffcab7a94caf70471a2eec56eb868573c.tar.xz
Add regex cache. Only caculate push actions for users that have sent read receipts, and are on that server
Diffstat (limited to '')
-rw-r--r--synapse/server.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/server.py b/synapse/server.py
index ffd4f936d0..63f9059837 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -96,6 +96,7 @@ class BaseHomeServer(object):
             hostname : The hostname for the server.
         """
         self.hostname = hostname
+        self.hostname_with_colon = ":" + hostname
         self._building = {}
 
         # Other kwargs are explicit dependencies
@@ -139,6 +140,9 @@ class BaseHomeServer(object):
     def is_mine(self, domain_specific_string):
         return domain_specific_string.domain == self.hostname
 
+    def is_mine_id(self, string):
+        return string.endswith(self.hostname_with_colon)
+
 # Build magic accessors for every dependency
 for depname in BaseHomeServer.DEPENDENCIES:
     BaseHomeServer._make_dependency_method(depname)