summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <dawagner@gmail.com>2015-10-16 15:23:30 +0100
committerDaniel Wagner-Hall <dawagner@gmail.com>2015-10-16 15:23:30 +0100
commite5acc8a47b3c535c121afb5fb58bc35bc26992ff (patch)
tree85755f9d0f088b4df0f984d302544f6ae18bdfc8 /synapse/handlers/_base.py
parentMerge pull request #309 from matrix-org/erikj/_filter_events_for_client (diff)
parentAdd signing host and keyname to signatures (diff)
downloadsynapse-e5acc8a47b3c535c121afb5fb58bc35bc26992ff.tar.xz
Merge pull request #302 from matrix-org/daniel/3pidinvites
Implement third party identifier invites
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index ee2d571329..6a26cb1879 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -21,6 +21,7 @@ from synapse.api.constants import Membership, EventTypes
 from synapse.types import UserID, RoomAlias
 
 from synapse.util.logcontext import PreserveLoggingContext
+from synapse.util import third_party_invites
 
 import logging
 
@@ -169,6 +170,16 @@ class BaseHandler(object):
                         )
                     )
 
+        if (
+            event.type == EventTypes.Member and
+            event.content["membership"] == Membership.JOIN and
+            third_party_invites.join_has_third_party_invite(event.content)
+        ):
+            yield third_party_invites.check_key_valid(
+                self.hs.get_simple_http_client(),
+                event
+            )
+
         federation_handler = self.hs.get_handlers().federation_handler
 
         if event.type == EventTypes.Member: