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

@ -105,6 +105,15 @@ func (d *Database) GetJoinedHostsForRooms(ctx context.Context, roomIDs []string)
return d.FederationSenderJoinedHosts.SelectJoinedHostsForRooms(ctx, roomIDs)
}
// GetJoinedHosts returns the currently joined hosts for room,
// as known to federationserver.
// Returns an error if something goes wrong.
func (d *Database) GetServerJoinedToRoom(
ctx context.Context, serverName gomatrixserverlib.ServerName, roomID string,
) (bool, error) {
return d.FederationSenderJoinedHosts.SelectServerJoinedToRoom(ctx, serverName, roomID)
}
// StoreJSON adds a JSON blob into the queue JSON table and returns
// a NID. The NID will then be used when inserting the per-destination
// metadata entries.