diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-09 13:21:00 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-09 13:21:00 +0100 |
commit | 3f84da139c99e6b5f38c01bd1614e9f0a55c2e27 (patch) | |
tree | 80847097e45ffdf986eb21eb2fd4e0f0171a662f /synapse/handlers/federation.py | |
parent | Merge pull request #764 from matrix-org/erikj/replication_logging (diff) | |
parent | Add and use get_domian_from_id (diff) | |
download | synapse-3f84da139c99e6b5f38c01bd1614e9f0a55c2e27.tar.xz |
Merge pull request #773 from matrix-org/erikj/get_domian_from_id
Add and use get_domain_from_id
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r-- | synapse/handlers/federation.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index d95e0b23b1..f38c6a8713 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -33,7 +33,7 @@ from synapse.util.frozenutils import unfreeze from synapse.crypto.event_signing import ( compute_event_signature, add_hashes_and_signatures, ) -from synapse.types import UserID +from synapse.types import UserID, get_domian_from_id from synapse.events.utils import prune_event @@ -453,7 +453,7 @@ class FederationHandler(BaseHandler): joined_domains = {} for u, d in joined_users: try: - dom = UserID.from_string(u).domain + dom = get_domian_from_id(u) old_d = joined_domains.get(dom) if old_d: joined_domains[dom] = min(d, old_d) @@ -743,9 +743,7 @@ class FederationHandler(BaseHandler): 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: logger.warn( "Failed to get destination from event %s", s.event_id @@ -970,9 +968,7 @@ class FederationHandler(BaseHandler): try: if k[0] == EventTypes.Member: if s.content["membership"] == Membership.LEAVE: - destinations.add( - UserID.from_string(s.state_key).domain - ) + destinations.add(get_domian_from_id(s.state_key)) except: logger.warn( "Failed to get destination from event %s", s.event_id |