summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-05-09 10:36:03 +0100
committerErik Johnston <erik@matrix.org>2016-05-09 10:36:03 +0100
commit08dfa8eee258a43177b843e6d708c8c98357c6d7 (patch)
treec9cd3c1960299ad7171a6f28e4b88415bb2da40f /synapse/handlers/_base.py
parentMerge pull request #767 from matrix-org/erikj/transaction_txn (diff)
downloadsynapse-08dfa8eee258a43177b843e6d708c8c98357c6d7.tar.xz
Add and use get_domian_from_id
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 13a675b208..287024c1ca 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -18,7 +18,7 @@ from twisted.internet import defer
 from synapse.api.errors import LimitExceededError, SynapseError, AuthError
 from synapse.crypto.event_signing import add_hashes_and_signatures
 from synapse.api.constants import Membership, EventTypes
-from synapse.types import UserID, RoomAlias, Requester
+from synapse.types import UserID, RoomAlias, Requester, get_domian_from_id
 from synapse.push.action_generator import ActionGenerator
 
 from synapse.util.logcontext import PreserveLoggingContext, preserve_fn
@@ -296,7 +296,7 @@ class BaseHandler(object):
                 return True
         for (state_key, membership) in room_members:
             if (
-                UserID.from_string(state_key).domain == self.hs.hostname
+                self.hs.is_mine_id(state_key)
                 and membership == Membership.JOIN
             ):
                 return True
@@ -421,9 +421,7 @@ class BaseHandler(object):
             try:
                 if k[0] == EventTypes.Member:
                     if s.content["membership"] == Membership.JOIN:
-                        destinations.add(
-                            UserID.from_string(s.state_key).domain
-                        )
+                        destinations.add(get_domian_from_id(s.state_key))
             except SynapseError:
                 logger.warn(
                     "Failed to get destination from event %s", s.event_id