summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2015-10-13 15:48:12 +0100
committerDaniel Wagner-Hall <daniel@matrix.org>2015-10-13 15:48:12 +0100
commit17dffef5ec74d789f68096c95d29cdcad57ce5c7 (patch)
treec28e54f40c79a4640aaeb1671efe8c1133980c13 /synapse/util
parentMerge branch 'develop' into daniel/3pidinvites (diff)
downloadsynapse-17dffef5ec74d789f68096c95d29cdcad57ce5c7.tar.xz
Move event contents into third_party_layout field
Diffstat (limited to '')
-rw-r--r--synapse/util/thirdpartyinvites.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/util/thirdpartyinvites.py b/synapse/util/thirdpartyinvites.py
index c30279de67..ad0f4e88e9 100644
--- a/synapse/util/thirdpartyinvites.py
+++ b/synapse/util/thirdpartyinvites.py
@@ -43,6 +43,12 @@ class ThirdPartyInvites(object):
         return True
 
     @classmethod
+    def join_has_third_party_invite(cls, content):
+        if "third_party_invite" not in content:
+            return False
+        return cls.has_join_keys(content["third_party_invite"])
+
+    @classmethod
     def copy_join_keys(cls, src, dst):
         for key in cls.JOIN_KEYS:
             if key in src:
@@ -53,8 +59,8 @@ class ThirdPartyInvites(object):
     def check_key_valid(cls, http_client, event):
         try:
             response = yield http_client.get_json(
-                event.content["key_validity_url"],
-                {"public_key": event.content["public_key"]}
+                event.content["third_party_invite"]["key_validity_url"],
+                {"public_key": event.content["third_party_invite"]["public_key"]}
             )
             if not response["valid"]:
                 raise AuthError(403, "Third party certificate was invalid")