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-01 17:49:52 +0100
committerDaniel Wagner-Hall <dawagner@gmail.com>2015-10-01 17:49:52 +0100
commit5b3e9713dd098df95b321f216105b2298deaeb92 (patch)
tree3a311c19ffaeede955b0059f6cac15874ca6ef06 /synapse/handlers/_base.py
parentMerge pull request #288 from matrix-org/markjh/unused_definitions (diff)
downloadsynapse-5b3e9713dd098df95b321f216105b2298deaeb92.tar.xz
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 60ac6617ae..52434920e3 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.thirdpartyinvites import ThirdPartyInvites
 
 import logging
 
@@ -123,6 +124,16 @@ class BaseHandler(object):
                         )
                     )
 
+        if (
+            event.type == EventTypes.Member and
+            event.content["membership"] == Membership.JOIN and
+            ThirdPartyInvites.has_join_keys(event.content)
+        ):
+            yield ThirdPartyInvites.check_key_valid(
+                self.hs.get_simple_http_client(),
+                event
+            )
+
         (event_stream_id, max_stream_id) = yield self.store.persist_event(
             event, context=context
         )