Add QueryServerJoinedToRoom to federation sender API

This commit is contained in:
Neil Alexander 2021-11-04 12:15:48 +00:00
parent b9a575919a
commit 73c0c91bbd
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
9 changed files with 108 additions and 0 deletions

View file

@ -25,6 +25,16 @@ func (f *FederationSenderInternalAPI) QueryJoinedHostServerNamesInRoom(
return
}
// QueryJoinedHostServerNamesInRoom implements api.FederationSenderInternalAPI
func (f *FederationSenderInternalAPI) QueryServerJoinedToRoom(
ctx context.Context,
request *api.QueryServerJoinedToRoomRequest,
response *api.QueryServerJoinedToRoomResponse,
) (err error) {
response.Joined, err = f.db.GetServerJoinedToRoom(ctx, request.ServerName, request.RoomID)
return
}
func (a *FederationSenderInternalAPI) fetchServerKeysDirectly(ctx context.Context, serverName gomatrixserverlib.ServerName) (*gomatrixserverlib.ServerKeys, error) {
ctx, cancel := context.WithTimeout(ctx, time.Second*30)
defer cancel()