summary refs log tree commit diff
path: root/synapse/federation
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/federation
parentRemove /context/ request (diff)
downloadsynapse-d2fb2b8095ec7f5d00b51418e84b05a1b23b79b3.tar.xz
Implement invite part of invite join dance
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/replication.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index 37e7db0536..e358de942e 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -413,7 +413,7 @@ class ReplicationLayer(object):
     @defer.inlineCallbacks
     def on_invite_request(self, origin, content):
         pdu = Pdu(**content)
-        ret_pdu = yield self.handler.on_send_join_request(origin, pdu)
+        ret_pdu = yield self.handler.on_invite_request(origin, pdu)
         defer.returnValue((200, ret_pdu.get_dict()))
 
     @defer.inlineCallbacks
@@ -460,6 +460,19 @@ class ReplicationLayer(object):
 
         defer.returnValue(state)
 
+    @defer.inlineCallbacks
+    def send_invite(self, destination, context, event_id, pdu):
+        code, pdu_dict = yield self.transport_layer.send_invite(
+            destination=destination,
+            context=context,
+            event_id=event_id,
+            content=pdu.get_dict(),
+        )
+
+        logger.debug("Got response to send_invite: %s", pdu_dict)
+
+        defer.returnValue(Pdu(**pdu_dict))
+
     @log_function
     def _get_persisted_pdu(self, event_id):
         """ Get a PDU from the database with given origin and id.