mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
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
This commit is contained in:
parent
31c15dcb80
commit
a219ce8726
1
changelog.d/3899.bugfix
Normal file
1
changelog.d/3899.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
When we join a room, always try the server we used for the alias lookup first, to avoid unresponsive and out-of-date servers.
|
@ -583,6 +583,11 @@ class RoomMemberHandler(object):
|
|||||||
room_id = mapping["room_id"]
|
room_id = mapping["room_id"]
|
||||||
servers = mapping["servers"]
|
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.returnValue((RoomID.from_string(room_id), servers))
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
Loading…
Reference in New Issue
Block a user