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

@ -48,6 +48,12 @@ type FederationSenderInternalAPI interface {
request *PerformDirectoryLookupRequest,
response *PerformDirectoryLookupResponse,
) error
// QueryServerJoinedToRoom checks if a single server is in a room right now.
QueryServerJoinedToRoom(
ctx context.Context,
request *QueryServerJoinedToRoomRequest,
response *QueryServerJoinedToRoomResponse,
) error
// Query the server names of the joined hosts in a room.
// Unlike QueryJoinedHostsInRoom, this function returns a de-duplicated slice
// containing only the server names (without information for membership events).
@ -183,6 +189,17 @@ type QueryJoinedHostServerNamesInRoomResponse struct {
ServerNames []gomatrixserverlib.ServerName `json:"server_names"`
}
// QueryJoinedHostServerNamesInRoomRequest is a request to QueryJoinedHostServerNames
type QueryServerJoinedToRoomRequest struct {
ServerName gomatrixserverlib.ServerName `json:"server_name"`
RoomID string `json:"room_id"`
}
// QueryJoinedHostServerNamesInRoomResponse is a response to QueryJoinedHostServerNames
type QueryServerJoinedToRoomResponse struct {
Joined bool `json:"joined"`
}
type PerformBroadcastEDURequest struct {
}