From f645646ca90eb361c5673dc65bc82673de474559 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 29 Jun 2021 09:37:28 +0100 Subject: [PATCH] Restore the getServers RS query (needs optimisation) --- federationapi/routing/send.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 40d4b0338..d9d28fdcf 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -486,16 +486,14 @@ func (t *txnReq) getServers(ctx context.Context, roomID string) []gomatrixserver return t.servers } t.servers = []gomatrixserverlib.ServerName{t.Origin} - /* - serverReq := &api.QueryServerJoinedToRoomRequest{ - RoomID: roomID, - } - serverRes := &api.QueryServerJoinedToRoomResponse{} - if err := t.rsAPI.QueryServerJoinedToRoom(ctx, serverReq, serverRes); err == nil { - t.servers = append(t.servers, serverRes.ServerNames...) - util.GetLogger(ctx).Infof("Found %d server(s) to query for missing events in %q", len(t.servers), roomID) - } - */ + serverReq := &api.QueryServerJoinedToRoomRequest{ + RoomID: roomID, + } + serverRes := &api.QueryServerJoinedToRoomResponse{} + if err := t.rsAPI.QueryServerJoinedToRoom(ctx, serverReq, serverRes); err == nil { + t.servers = append(t.servers, serverRes.ServerNames...) + util.GetLogger(ctx).Infof("Found %d server(s) to query for missing events in %q", len(t.servers), roomID) + } return t.servers }