Add regex cache. Only caculate push actions for users that have sent read receipts, and are on that server

This commit is contained in:
Erik Johnston 2016-01-19 16:01:05 +00:00
parent d056a0a3d8
commit 5a7d1ecffc
7 changed files with 50 additions and 14 deletions

View file

@ -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)