Add query functions in the federation API

This commit is contained in:
Neil Alexander 2021-12-08 14:47:47 +00:00
parent 61406a6747
commit 739acc1291
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
4 changed files with 256 additions and 0 deletions

View file

@ -60,6 +60,25 @@ type FederationInternalAPI interface {
request *QueryJoinedHostServerNamesInRoomRequest,
response *QueryJoinedHostServerNamesInRoomResponse,
) error
QueryEventAuthFromFederation(
ctx context.Context,
request *QueryEventAuthFromFederationRequest,
response *QueryEventAuthFromFederationResponse,
) error
QueryStateIDsFromFederation(
ctx context.Context,
request *QueryStateIDsFromFederationRequest,
response *QueryStateIDsFromFederationResponse,
) error
QueryStateFromFederation(
ctx context.Context,
request *QueryStateFromFederationRequest,
response *QueryStateFromFederationResponse,
) error
// Handle an instruction to make_join & send_join with a remote server.
PerformJoin(
ctx context.Context,
@ -194,6 +213,36 @@ type QueryJoinedHostServerNamesInRoomResponse struct {
ServerNames []gomatrixserverlib.ServerName `json:"server_names"`
}
type QueryEventAuthFromFederationRequest struct {
RoomID string `json:"room_id"`
EventID string `json:"event_id"`
}
type QueryEventAuthFromFederationResponse struct {
Events []*gomatrixserverlib.Event `json:"events"`
}
type QueryStateIDsFromFederationRequest struct {
RoomID string `json:"room_id"`
EventID string `json:"event_id"`
}
type QueryStateIDsFromFederationResponse struct {
AuthEventIDs []string `json:"auth_event_ids"`
StateEventIDs []string `json:"state_event_ids"`
}
type QueryStateFromFederationRequest struct {
RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
RoomID string `json:"room_id"`
EventID string `json:"event_id"`
}
type QueryStateFromFederationResponse struct {
AuthEvents []*gomatrixserverlib.Event `json:"auth_events"`
StateEvents []*gomatrixserverlib.Event `json:"state_events"`
}
type PerformBroadcastEDURequest struct {
}