summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-09 14:47:27 +0000
committerErik Johnston <erik@matrix.org>2014-12-09 14:47:27 +0000
commit5eca288d280659e69fce5d5eca3e7bf09faac5f0 (patch)
treece7978111ad80afd324bb5936e1f4ba6a3e1f069 /synapse/handlers/_base.py
parentChange the way we implement get_events to be less sucky (diff)
downloadsynapse-5eca288d280659e69fce5d5eca3e7bf09faac5f0.tar.xz
Fix joining from an invite
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 46c2b0a690..2c737c8bf9 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -113,6 +113,20 @@ class BaseHandler(object):
 
         yield self.store.persist_event(event, context=context)
 
+        federation_handler = self.hs.get_handlers().federation_handler
+
+        if event.type == EventTypes.Member:
+            if event.content["membership"] == Membership.INVITE:
+                invitee = self.hs.parse_userid(event.state_key)
+                if not self.hs.is_mine(invitee):
+                    returned_invite = yield federation_handler.send_invite(
+                        invitee.domain,
+                        event,
+                    )
+                    event.signatures.update(
+                        returned_invite.signatures
+                    )
+
         destinations = set(extra_destinations)
         for k, s in context.current_state.items():
             try:
@@ -128,7 +142,6 @@ class BaseHandler(object):
 
         yield self.notifier.on_new_room_event(event, extra_users=extra_users)
 
-        federation_handler = self.hs.get_handlers().federation_handler
         yield federation_handler.handle_new_event(
             event,
             None,