summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-07 13:41:00 +0000
committerErik Johnston <erik@matrix.org>2014-11-07 13:41:00 +0000
commitd2fb2b8095ec7f5d00b51418e84b05a1b23b79b3 (patch)
treec30e569f38d087093b4a867012ca89c2370c064f /synapse/handlers/_base.py
parentRemove /context/ request (diff)
downloadsynapse-d2fb2b8095ec7f5d00b51418e84b05a1b23b79b3.tar.xz
Implement invite part of invite join dance
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index f630280031..9dc2fc2e0f 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -56,7 +56,8 @@ class BaseHandler(object):
 
     @defer.inlineCallbacks
     def _on_new_room_event(self, event, snapshot, extra_destinations=[],
-                           extra_users=[], suppress_auth=False):
+                           extra_users=[], suppress_auth=False,
+                           do_invite_host=None):
         yield run_on_reactor()
 
         snapshot.fill_out_prev_events(event)
@@ -80,6 +81,16 @@ class BaseHandler(object):
         else:
             logger.debug("Suppressed auth.")
 
+        if do_invite_host:
+            federation_handler = self.hs.get_handlers().federation_handler
+            invite_event = yield federation_handler.send_invite(
+                do_invite_host,
+                event
+            )
+
+            # FIXME: We need to check if the remote changed anything else
+            event.signatures = invite_event.signatures
+
         yield self.store.persist_event(event)
 
         destinations = set(extra_destinations)