mirror of
https://github.com/element-hq/synapse
synced 2024-09-04 06:40:06 +00:00
When returning lists of servers from alias lookups, put the current server first in the list
This commit is contained in:
parent
ff78eded01
commit
95e2d2d36d
1 changed files with 10 additions and 1 deletions
|
@ -113,7 +113,16 @@ class DirectoryHandler(BaseHandler):
|
||||||
)
|
)
|
||||||
|
|
||||||
extra_servers = yield self.store.get_joined_hosts_for_room(room_id)
|
extra_servers = yield self.store.get_joined_hosts_for_room(room_id)
|
||||||
servers = list(set(extra_servers) | set(servers))
|
servers = set(extra_servers) | set(servers)
|
||||||
|
|
||||||
|
# If this server is in the list of servers, return it first.
|
||||||
|
if self.server_name in servers:
|
||||||
|
servers = (
|
||||||
|
[self.server_name]
|
||||||
|
+ [s for s in servers if s != self.server_name]
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
servers = list(servers)
|
||||||
|
|
||||||
defer.returnValue({
|
defer.returnValue({
|
||||||
"room_id": room_id,
|
"room_id": room_id,
|
||||||
|
|
Loading…
Reference in a new issue