summary refs log tree commit diff
path: root/synapse/federation/transport.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-10-16 16:56:51 +0100
committerErik Johnston <erik@matrix.org>2014-10-16 16:56:51 +0100
commit1116f5330ec80533954026f67018e0db190cbae0 (patch)
tree6f559db890c6940b431c8aacb0836a24f0dbcf6e /synapse/federation/transport.py
parentBegin making auth use event.old_state_events (diff)
downloadsynapse-1116f5330ec80533954026f67018e0db190cbae0.tar.xz
Start implementing the invite/join dance. Continue moving auth to use event.state_events
Diffstat (limited to 'synapse/federation/transport.py')
-rw-r--r--synapse/federation/transport.py34
1 files changed, 33 insertions, 1 deletions
diff --git a/synapse/federation/transport.py b/synapse/federation/transport.py
index 755eee8cf6..4f552272e6 100644
--- a/synapse/federation/transport.py
+++ b/synapse/federation/transport.py
@@ -198,6 +198,19 @@ class TransportLayer(object):
         defer.returnValue(response)
 
     @defer.inlineCallbacks
+    @log_function
+    def make_join(self, destination, context, user_id, retry_on_dns_fail=True):
+        path = PREFIX + "/make_join/%s/%s" % (context, user_id,)
+
+        response = yield self.client.get_json(
+            destination=destination,
+            path=path,
+            retry_on_dns_fail=retry_on_dns_fail,
+        )
+
+        defer.returnValue(response)
+
+    @defer.inlineCallbacks
     def _authenticate_request(self, request):
         json_request = {
             "method": request.method,
@@ -353,6 +366,12 @@ class TransportLayer(object):
             )
         )
 
+        self.server.register_path(
+            "GET",
+            re.compile("^" + PREFIX + "/make_join/([^/]*)/([^/]*)$"),
+            self._on_make_join_request
+        )
+
     @defer.inlineCallbacks
     @log_function
     def _on_send_request(self, origin, content, query, transaction_id):
@@ -438,7 +457,20 @@ class TransportLayer(object):
         versions = [v.split(",", 1) for v in v_list]
 
         return self.request_handler.on_backfill_request(
-            context, versions, limit)
+            context, versions, limit
+        )
+
+    @log_function
+    def _on_make_join_request(self, origin, content, query, context, user_id):
+        return self.request_handler.on_make_join_request(
+            context, user_id,
+        )
+
+    @log_function
+    def _on_send_join_request(self, origin, content, query):
+        return self.request_handler.on_send_join_request(
+            origin, content,
+        )
 
 
 class TransportReceivedHandler(object):