0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/client/rooms/initialsync: Remove event_id host regression.

This commit is contained in:
Jason Volk 2019-07-15 21:22:43 -07:00
parent 4f88697620
commit 270cf6564c

View file

@ -263,20 +263,28 @@ get__initialsync_remote(client &client,
const resource::request &request,
const m::room &room)
{
const m::room::origins origins{room};
char server_buf[384];
const string_view server
{
origins.random(server_buf, [](const string_view &origin)
{
return !my_host(origin);
})
};
const net::hostport remote
{
server?: room.room_id.host()
};
const auto head
{
m::v1::fetch_head(room, room.room_id.host(), request.user_id)
m::v1::fetch_head(room, remote, request.user_id)
};
m::room room_{room};
room_.event_id = head;
const net::hostport remote
{
my_host(room_.event_id.host())?
room_.room_id.host():
room_.event_id.host()
};
m::fetch::state_ids(room_);
}