summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-09-18 18:27:37 +0100
committerGitHub <noreply@github.com>2018-09-18 18:27:37 +0100
commita219ce87263ad9be887cf039a04b4a1f06b7b0b8 (patch)
tree3e7c239e0f82bdf5ffc9b085e7de1f59b6f33486 /synapse/handlers
parentRefactor matrixfederationclient to fix logging (#3906) (diff)
downloadsynapse-a219ce87263ad9be887cf039a04b4a1f06b7b0b8.tar.xz
Use directory server for room joins (#3899)
When we do a join, always try the server we used for the alias lookup first.

Fixes #2418
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room_member.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index f643619047..07fd3e82fc 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -583,6 +583,11 @@ class RoomMemberHandler(object):
         room_id = mapping["room_id"]
         servers = mapping["servers"]
 
+        # put the server which owns the alias at the front of the server list.
+        if room_alias.domain in servers:
+            servers.remove(room_alias.domain)
+        servers.insert(0, room_alias.domain)
+
         defer.returnValue((RoomID.from_string(room_id), servers))
 
     @defer.inlineCallbacks