summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-10-13 18:00:38 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-10-13 18:00:38 +0100
commit0c38e8637ff549a21c763f02f52306b5c729d26b (patch)
tree0716833810464862098b2ec939126b59a1de2cd6 /synapse/handlers
parentMove logic into handler (diff)
downloadsynapse-0c38e8637ff549a21c763f02f52306b5c729d26b.tar.xz
Remove unnecessary class-wrapping
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/_base.py6
-rw-r--r--synapse/handlers/federation.py13
2 files changed, 10 insertions, 9 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 4165c56bed..97edec6ec6 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -21,7 +21,7 @@ from synapse.api.constants import Membership, EventTypes
 from synapse.types import UserID, RoomAlias
 
 from synapse.util.logcontext import PreserveLoggingContext
-from synapse.util.thirdpartyinvites import ThirdPartyInvites
+from synapse.util import third_party_invites
 
 import logging
 
@@ -127,9 +127,9 @@ class BaseHandler(object):
         if (
             event.type == EventTypes.Member and
             event.content["membership"] == Membership.JOIN and
-            ThirdPartyInvites.join_has_third_party_invite(event.content)
+            third_party_invites.join_has_third_party_invite(event.content)
         ):
-            yield ThirdPartyInvites.check_key_valid(
+            yield third_party_invites.check_key_valid(
                 self.hs.get_simple_http_client(),
                 event
             )
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index f10e5192e2..2b3c4cec8e 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -39,7 +39,7 @@ from twisted.internet import defer
 
 import itertools
 import logging
-from synapse.util.thirdpartyinvites import ThirdPartyInvites
+from synapse.util import third_party_invites
 
 logger = logging.getLogger(__name__)
 
@@ -704,9 +704,10 @@ class FederationHandler(BaseHandler):
         process it until the other server has signed it and sent it back.
         """
         event_content = {"membership": Membership.JOIN}
-        if ThirdPartyInvites.has_join_keys(query):
-            event_content["third_party_invite"] = {}
-            ThirdPartyInvites.copy_join_keys(query, event_content["third_party_invite"])
+        if third_party_invites.has_join_keys(query):
+            event_content["third_party_invite"] = (
+                third_party_invites.extract_join_keys(query)
+            )
 
         builder = self.event_builder_factory.new({
             "type": EventTypes.Member,
@@ -722,8 +723,8 @@ class FederationHandler(BaseHandler):
 
         self.auth.check(event, auth_events=context.current_state)
 
-        if ThirdPartyInvites.join_has_third_party_invite(event.content):
-            ThirdPartyInvites.check_key_valid(self.hs.get_simple_http_client(), event)
+        if third_party_invites.join_has_third_party_invite(event.content):
+            third_party_invites.check_key_valid(self.hs.get_simple_http_client(), event)
 
         defer.returnValue(event)