api

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 129

Documentation

Overview

Package api provides the types that are used to communicate with the roomserver.

Index

Constants

View Source
const DoNotSendToOtherServers = ""

DoNotSendToOtherServers tells us not to send the event to other matrix servers.

Variables

This section is empty.

Functions

func GetEvent

GetEvent returns the event or nil, even on errors.

func GetStateEvent

GetStateEvent returns the current state event in the room or nil.

func IsServerBannedFromRoom

func IsServerBannedFromRoom(ctx context.Context, rsAPI RoomserverInternalAPI, roomID string, serverName gomatrixserverlib.ServerName) bool

IsServerBannedFromRoom returns whether the server is banned from a room by server ACLs.

func PopulatePublicRooms

func PopulatePublicRooms(ctx context.Context, roomIDs []string, rsAPI RoomserverInternalAPI) ([]gomatrixserverlib.PublicRoom, error)

PopulatePublicRooms extracts PublicRoom information for all the provided room IDs. The IDs are not checked to see if they are visible in the published room directory. due to lots of switches

func SendEventWithState

func SendEventWithState(
	ctx context.Context, rsAPI RoomserverInternalAPI, kind Kind,
	state *gomatrixserverlib.RespState, event *gomatrixserverlib.HeaderedEvent,
	haveEventIDs map[string]bool,
) error

SendEventWithState writes an event with the specified kind to the roomserver with the state at the event as KindOutlier before it. Will not send any event that is marked as `true` in haveEventIDs.

func SendEvents

func SendEvents(
	ctx context.Context, rsAPI RoomserverInternalAPI,
	kind Kind, events []*gomatrixserverlib.HeaderedEvent,
	sendAsServer gomatrixserverlib.ServerName, txnID *TransactionID,
) error

SendEvents to the roomserver The events are written with KindNew.

func SendInputRoomEvents

func SendInputRoomEvents(
	ctx context.Context, rsAPI RoomserverInternalAPI, ires []InputRoomEvent,
) error

SendInputRoomEvents to the roomserver.

func SendInvite

SendInvite event to the roomserver. This should only be needed for invite events that occur outside of a known room. If we are in the room then the event should be sent using the SendEvents method.

Types

type GetAliasesForRoomIDRequest

type GetAliasesForRoomIDRequest struct {
	// The room ID we want to find aliases for
	RoomID string `json:"room_id"`
}

GetAliasesForRoomIDRequest is a request to GetAliasesForRoomID

type GetAliasesForRoomIDResponse

type GetAliasesForRoomIDResponse struct {
	// The aliases the alias refers to
	Aliases []string `json:"aliases"`
}

GetAliasesForRoomIDResponse is a response to GetAliasesForRoomID

type GetCreatorIDForAliasRequest

type GetCreatorIDForAliasRequest struct {
	// The alias we want to find the creator of
	Alias string `json:"alias"`
}

GetCreatorIDForAliasRequest is a request to GetCreatorIDForAlias

type GetCreatorIDForAliasResponse

type GetCreatorIDForAliasResponse struct {
	// The user ID of the alias creator
	UserID string `json:"user_id"`
}

GetCreatorIDForAliasResponse is a response to GetCreatorIDForAlias

type GetRoomIDForAliasRequest

type GetRoomIDForAliasRequest struct {
	// Alias we want to lookup
	Alias string `json:"alias"`
	// Should we ask appservices for their aliases as a part of
	// the request?
	IncludeAppservices bool `json:"include_appservices"`
}

GetRoomIDForAliasRequest is a request to GetRoomIDForAlias

type GetRoomIDForAliasResponse

type GetRoomIDForAliasResponse struct {
	// The room ID the alias refers to
	RoomID string `json:"room_id"`
}

GetRoomIDForAliasResponse is a response to GetRoomIDForAlias

type InputRoomEvent

type InputRoomEvent struct {
	// Whether this event is new, backfilled or an outlier.
	// This controls how the event is processed.
	Kind Kind `json:"kind"`
	// The event JSON for the event to add.
	Event *gomatrixserverlib.HeaderedEvent `json:"event"`
	// List of state event IDs that authenticate this event.
	// These are likely derived from the "auth_events" JSON key of the event.
	// But can be different because the "auth_events" key can be incomplete or wrong.
	// For example many matrix events forget to reference the m.room.create event even though it is needed for auth.
	// (since synapse allows this to happen we have to allow it as well.)
	AuthEventIDs []string `json:"auth_event_ids"`
	// Whether the state is supplied as a list of event IDs or whether it
	// should be derived from the state at the previous events.
	HasState bool `json:"has_state"`
	// Optional list of state event IDs forming the state before this event.
	// These state events must have already been persisted.
	// These are only used if HasState is true.
	// The list can be empty, for example when storing the first event in a room.
	StateEventIDs []string `json:"state_event_ids"`
	// The server name to use to push this event to other servers.
	// Or empty if this event shouldn't be pushed to other servers.
	SendAsServer string `json:"send_as_server"`
	// The transaction ID of the send request if sent by a local user and one
	// was specified
	TransactionID *TransactionID `json:"transaction_id"`
}

InputRoomEvent is a matrix room event to add to the room server database. TODO: Implement UnmarshalJSON/MarshalJSON in a way that does something sensible with the event JSON.

type InputRoomEventsRequest

type InputRoomEventsRequest struct {
	InputRoomEvents []InputRoomEvent `json:"input_room_events"`
}

InputRoomEventsRequest is a request to InputRoomEvents

type InputRoomEventsResponse

type InputRoomEventsResponse struct {
	ErrMsg     string // set if there was any error
	NotAllowed bool   // true if an event in the input was not allowed.
}

InputRoomEventsResponse is a response to InputRoomEvents

func (*InputRoomEventsResponse) Err

func (r *InputRoomEventsResponse) Err() error

type Kind added in v0.2.0

type Kind int
const (
	// KindOutlier event fall outside the contiguous event graph.
	// We do not have the state for these events.
	// These events are state events used to authenticate other events.
	// They can become part of the contiguous event graph via backfill.
	KindOutlier Kind = iota + 1
	// KindNew event extend the contiguous graph going forwards.
	// They usually don't need state, but may include state if the
	// there was a new event that references an event that we don't
	// have a copy of. New events will influence the fwd extremities
	// of the room and output events will be generated as a result.
	KindNew
	// KindOld event extend the graph backwards, or fill gaps in
	// history. They may or may not include state. They will not be
	// considered for forward extremities, and output events will NOT
	// be generated for them.
	KindOld
)

type OutputEvent

type OutputEvent struct {
	// What sort of event this is.
	Type OutputType `json:"type"`
	// The content of event with type OutputTypeNewRoomEvent
	NewRoomEvent *OutputNewRoomEvent `json:"new_room_event,omitempty"`
	// The content of event with type OutputTypeOldRoomEvent
	OldRoomEvent *OutputOldRoomEvent `json:"old_room_event,omitempty"`
	// The content of event with type OutputTypeNewInviteEvent
	NewInviteEvent *OutputNewInviteEvent `json:"new_invite_event,omitempty"`
	// The content of event with type OutputTypeRetireInviteEvent
	RetireInviteEvent *OutputRetireInviteEvent `json:"retire_invite_event,omitempty"`
	// The content of event with type OutputTypeRedactedEvent
	RedactedEvent *OutputRedactedEvent `json:"redacted_event,omitempty"`
	// The content of event with type OutputTypeNewPeek
	NewPeek *OutputNewPeek `json:"new_peek,omitempty"`
	// The content of event with type OutputTypeNewInboundPeek
	NewInboundPeek *OutputNewInboundPeek `json:"new_inbound_peek,omitempty"`
	// The content of event with type OutputTypeRetirePeek
	RetirePeek *OutputRetirePeek `json:"retire_peek,omitempty"`
}

An OutputEvent is an entry in the roomserver output kafka log. Consumers should check the type field when consuming this event.

type OutputNewInboundPeek added in v0.3.7

type OutputNewInboundPeek struct {
	RoomID string
	PeekID string
	// the event ID at which the peek begins (so we can avoid
	// a race between tracking the state returned by /peek and emitting subsequent
	// peeked events)
	LatestEventID string
	ServerName    gomatrixserverlib.ServerName
	// how often we told the peeking server to renew the peek
	RenewalInterval int64
}

An OutputNewInboundPeek is written whenever a server starts peeking into a room

type OutputNewInviteEvent

type OutputNewInviteEvent struct {
	// The room version of the invited room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// The "m.room.member" invite event.
	Event *gomatrixserverlib.HeaderedEvent `json:"event"`
}

An OutputNewInviteEvent is written whenever an invite becomes active. Invite events can be received outside of an existing room so have to be tracked separately from the room events themselves.

type OutputNewPeek

type OutputNewPeek struct {
	RoomID   string
	UserID   string
	DeviceID string
}

An OutputNewPeek is written whenever a user starts peeking into a room using a given device.

type OutputNewRoomEvent

type OutputNewRoomEvent struct {
	// The Event.
	Event *gomatrixserverlib.HeaderedEvent `json:"event"`
	// Does the event completely rewrite the room state? If so, then AddsStateEventIDs
	// will contain the entire room state.
	RewritesState bool `json:"rewrites_state"`
	// The latest events in the room after this event.
	// This can be used to set the prev events for new events in the room.
	// This also can be used to get the full current state after this event.
	LatestEventIDs []string `json:"latest_event_ids"`
	// The state event IDs that were added to the state of the room by this event.
	// Together with RemovesStateEventIDs this allows the receiver to keep an up to date
	// view of the current state of the room.
	AddsStateEventIDs []string `json:"adds_state_event_ids"`
	// All extra newly added state events. This is only set if there are *extra* events
	// other than `Event`. This can happen when forks get merged because state resolution
	// may decide a bunch of state events on one branch are now valid, so they will be
	// present in this list. This is useful when trying to maintain the current state of a room
	// as to do so you need to include both these events and `Event`.
	AddStateEvents []*gomatrixserverlib.HeaderedEvent `json:"adds_state_events"`

	// The state event IDs that were removed from the state of the room by this event.
	RemovesStateEventIDs []string `json:"removes_state_event_ids"`
	// The ID of the event that was output before this event.
	// Or the empty string if this is the first event output for this room.
	// This is used by consumers to check if they can safely update their
	// current state using the delta supplied in AddsStateEventIDs and
	// RemovesStateEventIDs.
	//
	// If the LastSentEventID doesn't match what they were expecting it to be
	// they can use the LatestEventIDs to request the full current state.
	LastSentEventID string `json:"last_sent_event_id"`
	// The state event IDs that are part of the state at the event, but not
	// part of the current state. Together with the StateBeforeRemovesEventIDs
	// this can be used to construct the state before the event from the
	// current state. The StateBeforeAddsEventIDs and StateBeforeRemovesEventIDs
	// delta is applied after the AddsStateEventIDs and RemovesStateEventIDs.
	//
	// Consumers need to know the state at each event in order to determine
	// which users and servers are allowed to see the event. This information
	// is needed to apply the history visibility rules and to tell which
	// servers we need to push events to over federation.
	//
	// The state is given as a delta against the current state because they are
	// usually either the same state, or differ by just a couple of events.
	StateBeforeAddsEventIDs []string `json:"state_before_adds_event_ids"`
	// The state event IDs that are part of the current state, but not part
	// of the state at the event.
	StateBeforeRemovesEventIDs []string `json:"state_before_removes_event_ids"`
	// The server name to use to push this event to other servers.
	// Or empty if this event shouldn't be pushed to other servers.
	//
	// This is used by the federation sender component. We need to tell it what
	// event it needs to send because it can't tell on its own. Normally if an
	// event was created on this server then we are responsible for sending it.
	// However there are a couple of exceptions. The first is that when the
	// server joins a remote room through another matrix server, it is the job
	// of the other matrix server to send the event over federation. The second
	// is the reverse of the first, that is when a remote server joins a room
	// that we are in over federation using our server it is our responsibility
	// to send the join event to other matrix servers.
	//
	// We encode the server name that the event should be sent using here to
	// future proof the API for virtual hosting.
	SendAsServer string `json:"send_as_server"`
	// The transaction ID of the send request if sent by a local user and one
	// was specified
	TransactionID *TransactionID `json:"transaction_id"`
}

An OutputNewRoomEvent is written when the roomserver receives a new event. It contains the full matrix room event and enough information for a consumer to construct the current state of the room and the state before the event.

When we talk about state in a matrix room we are talking about the state after a list of events. The current state is the state after the latest event IDs in the room. The state before an event is the state after its prev_events.

func (*OutputNewRoomEvent) AddsState

AddsState returns all added state events from this event.

This function is needed because `AddStateEvents` will not include a copy of the original event to save space, so you cannot use that slice alone. Instead, use this function which will add the original event if it is present in `AddsStateEventIDs`.

type OutputOldRoomEvent added in v0.2.0

type OutputOldRoomEvent struct {
	// The Event.
	Event *gomatrixserverlib.HeaderedEvent `json:"event"`
}

An OutputOldRoomEvent is written when the roomserver receives an old event. This will typically happen as a result of getting either missing events or backfilling. Downstream components may wish to send these events to clients when it is advantageous to do so, but with the consideration that the event is likely a historic event.

Old events do not update forward extremities or the current room state, therefore they must not be treated as if they do. Downstream components should build their current room state up from OutputNewRoomEvents only.

type OutputRedactedEvent

type OutputRedactedEvent struct {
	// The event ID that was redacted
	RedactedEventID string
	// The value of `unsigned.redacted_because` - the redaction event itself
	RedactedBecause *gomatrixserverlib.HeaderedEvent
}

An OutputRedactedEvent is written whenever a redaction has been /validated/. Downstream components MUST redact the given event ID if they have stored the event JSON. It is guaranteed that this event ID has been seen before.

type OutputRetireInviteEvent

type OutputRetireInviteEvent struct {
	// The ID of the "m.room.member" invite event.
	EventID string
	// The target user ID of the "m.room.member" invite event that was retired.
	TargetUserID string
	// Optional event ID of the event that replaced the invite.
	// This can be empty if the invite was rejected locally and we were unable
	// to reach the server that originally sent the invite.
	RetiredByEventID string
	// The "membership" of the user after retiring the invite. One of "join"
	// "leave" or "ban".
	Membership string
}

An OutputRetireInviteEvent is written whenever an existing invite is no longer active. An invite stops being active if the user joins the room or if the invite is rejected by the user.

type OutputRetirePeek added in v0.3.3

type OutputRetirePeek struct {
	RoomID   string
	UserID   string
	DeviceID string
}

An OutputRetirePeek is written whenever a user stops peeking into a room.

type OutputRoomEventType

type OutputRoomEventType int

Type of the OutputNewRoomEvent.

const (
	// The event is a timeline event and likely just happened.
	OutputRoomTimeline OutputRoomEventType = iota

	// The event is a state event and quite possibly happened in the past.
	OutputRoomState
)

type OutputType

type OutputType string

An OutputType is a type of roomserver output.

const (
	// OutputTypeNewRoomEvent indicates that the event is an OutputNewRoomEvent
	OutputTypeNewRoomEvent OutputType = "new_room_event"
	// OutputTypeOldRoomEvent indicates that the event is an OutputOldRoomEvent
	OutputTypeOldRoomEvent OutputType = "old_room_event"
	// OutputTypeNewInviteEvent indicates that the event is an OutputNewInviteEvent
	OutputTypeNewInviteEvent OutputType = "new_invite_event"
	// OutputTypeRetireInviteEvent indicates that the event is an OutputRetireInviteEvent
	OutputTypeRetireInviteEvent OutputType = "retire_invite_event"
	// OutputTypeRedactedEvent indicates that the event is an OutputRedactedEvent
	//
	// This event is emitted when a redaction has been 'validated' (meaning both the redaction and the event to redact are known).
	// Redaction validation happens when the roomserver receives either:
	// - A redaction for which we have the event to redact.
	// - Any event for which we have a redaction.
	// When the roomserver receives an event, it will check against the redactions table to see if there is a matching redaction
	// for the event. If there is, it will mark the redaction as validated and emit this event. In the common case of a redaction
	// happening after receiving the event to redact, the roomserver will emit a OutputTypeNewRoomEvent of m.room.redaction
	// immediately followed by a OutputTypeRedactedEvent. In the uncommon case of receiving the redaction BEFORE the event to redact,
	// the roomserver will emit a OutputTypeNewRoomEvent of the event to redact immediately followed by a OutputTypeRedactedEvent.
	//
	// In order to honour redactions correctly, downstream components must ignore m.room.redaction events emitted via OutputTypeNewRoomEvent.
	// When downstream components receive an OutputTypeRedactedEvent they must:
	// - Pull out the event to redact from the database. They should have this because the redaction is validated.
	// - Redact the event and set the corresponding `unsigned` fields to indicate it as redacted.
	// - Replace the event in the database.
	OutputTypeRedactedEvent OutputType = "redacted_event"

	// OutputTypeNewPeek indicates that the kafka event is an OutputNewPeek
	OutputTypeNewPeek OutputType = "new_peek"
	// OutputTypeNewInboundPeek indicates that the kafka event is an OutputNewInboundPeek
	OutputTypeNewInboundPeek OutputType = "new_inbound_peek"
	// OutputTypeRetirePeek indicates that the kafka event is an OutputRetirePeek
	OutputTypeRetirePeek OutputType = "retire_peek"
)

type PerformBackfillRequest

type PerformBackfillRequest struct {
	// The room to backfill
	RoomID string `json:"room_id"`
	// A map of backwards extremity event ID to a list of its prev_event IDs.
	BackwardsExtremities map[string][]string `json:"backwards_extremities"`
	// The maximum number of events to retrieve.
	Limit int `json:"limit"`
	// The server interested in the events.
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
}

PerformBackfillRequest is a request to PerformBackfill.

func (*PerformBackfillRequest) PrevEventIDs

func (r *PerformBackfillRequest) PrevEventIDs() []string

PrevEventIDs returns the prev_event IDs of all backwards extremities, de-duplicated in a lexicographically sorted order.

type PerformBackfillResponse

type PerformBackfillResponse struct {
	// Missing events, arbritrary order.
	Events []*gomatrixserverlib.HeaderedEvent `json:"events"`
}

PerformBackfillResponse is a response to PerformBackfill.

type PerformError

type PerformError struct {
	Msg        string
	RemoteCode int // remote HTTP status code, for PerformErrRemote
	Code       PerformErrorCode
}

func (*PerformError) Error

func (p *PerformError) Error() string

func (*PerformError) JSONResponse

func (p *PerformError) JSONResponse() util.JSONResponse

JSONResponse maps error codes to suitable HTTP error codes, defaulting to 500.

type PerformErrorCode

type PerformErrorCode int
const (
	// PerformErrorNotAllowed means the user is not allowed to invite/join/etc this room (e.g join_rule:invite or banned)
	PerformErrorNotAllowed PerformErrorCode = 1
	// PerformErrorBadRequest means the request was wrong in some way (invalid user ID, wrong server, etc)
	PerformErrorBadRequest PerformErrorCode = 2
	// PerformErrorNoRoom means that the room being joined doesn't exist.
	PerformErrorNoRoom PerformErrorCode = 3
	// PerformErrorNoOperation means that the request resulted in nothing happening e.g invite->invite or leave->leave.
	PerformErrorNoOperation PerformErrorCode = 4
	// PerformErrRemote means that the request failed and the PerformError.Msg is the raw remote JSON error response
	PerformErrRemote PerformErrorCode = 5
)

type PerformForgetRequest added in v0.3.0

type PerformForgetRequest struct {
	RoomID string `json:"room_id"`
	UserID string `json:"user_id"`
}

PerformForgetRequest is a request to PerformForget

type PerformForgetResponse added in v0.3.0

type PerformForgetResponse struct{}

type PerformInboundPeekRequest added in v0.3.7

type PerformInboundPeekRequest struct {
	UserID          string                       `json:"user_id"`
	RoomID          string                       `json:"room_id"`
	PeekID          string                       `json:"peek_id"`
	ServerName      gomatrixserverlib.ServerName `json:"server_name"`
	RenewalInterval int64                        `json:"renewal_interval"`
}

type PerformInboundPeekResponse added in v0.3.7

type PerformInboundPeekResponse struct {
	// Does the room exist on this roomserver?
	// If the room doesn't exist this will be false and StateEvents will be empty.
	RoomExists bool `json:"room_exists"`
	// The room version of the room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// The current state and auth chain events.
	// The lists will be in an arbitrary order.
	StateEvents     []*gomatrixserverlib.HeaderedEvent `json:"state_events"`
	AuthChainEvents []*gomatrixserverlib.HeaderedEvent `json:"auth_chain_events"`
	// The event at which this state was captured
	LatestEvent *gomatrixserverlib.HeaderedEvent `json:"latest_event"`
}

type PerformInviteRequest

type PerformInviteRequest struct {
	RoomVersion     gomatrixserverlib.RoomVersion             `json:"room_version"`
	Event           *gomatrixserverlib.HeaderedEvent          `json:"event"`
	InviteRoomState []gomatrixserverlib.InviteV2StrippedState `json:"invite_room_state"`
	SendAsServer    string                                    `json:"send_as_server"`
	TransactionID   *TransactionID                            `json:"transaction_id"`
}

type PerformInviteResponse

type PerformInviteResponse struct {
	Error *PerformError
}

type PerformJoinRequest

type PerformJoinRequest struct {
	RoomIDOrAlias string                         `json:"room_id_or_alias"`
	UserID        string                         `json:"user_id"`
	Content       map[string]interface{}         `json:"content"`
	ServerNames   []gomatrixserverlib.ServerName `json:"server_names"`
}

type PerformJoinResponse

type PerformJoinResponse struct {
	// The room ID, populated on success.
	RoomID    string `json:"room_id"`
	JoinedVia gomatrixserverlib.ServerName
	// If non-nil, the join request failed. Contains more information why it failed.
	Error *PerformError
}

type PerformLeaveRequest

type PerformLeaveRequest struct {
	RoomID string `json:"room_id"`
	UserID string `json:"user_id"`
}

type PerformLeaveResponse

type PerformLeaveResponse struct {
}

type PerformPeekRequest

type PerformPeekRequest struct {
	RoomIDOrAlias string                         `json:"room_id_or_alias"`
	UserID        string                         `json:"user_id"`
	DeviceID      string                         `json:"device_id"`
	ServerNames   []gomatrixserverlib.ServerName `json:"server_names"`
}

type PerformPeekResponse

type PerformPeekResponse struct {
	// The room ID, populated on success.
	RoomID string `json:"room_id"`
	// If non-nil, the join request failed. Contains more information why it failed.
	Error *PerformError
}

type PerformPublishRequest

type PerformPublishRequest struct {
	RoomID     string
	Visibility string
}

type PerformPublishResponse

type PerformPublishResponse struct {
	// If non-nil, the publish request failed. Contains more information why it failed.
	Error *PerformError
}

type PerformUnpeekRequest added in v0.3.3

type PerformUnpeekRequest struct {
	RoomID   string `json:"room_id"`
	UserID   string `json:"user_id"`
	DeviceID string `json:"device_id"`
}

type PerformUnpeekResponse added in v0.3.3

type PerformUnpeekResponse struct {
	// If non-nil, the join request failed. Contains more information why it failed.
	Error *PerformError
}

type QueryAuthChainRequest added in v0.3.3

type QueryAuthChainRequest struct {
	EventIDs []string
}

type QueryAuthChainResponse added in v0.3.3

type QueryAuthChainResponse struct {
	AuthChain []*gomatrixserverlib.HeaderedEvent
}

type QueryBulkStateContentRequest

type QueryBulkStateContentRequest struct {
	// Returns state events in these rooms
	RoomIDs []string
	// If true, treats the '*' StateKey as "all state events of this type" rather than a literal value of '*'
	AllowWildcards bool
	// The state events to return. Only a small subset of tuples are allowed in this request as only certain events
	// have their content fields extracted. Specifically, the tuple Type must be one of:
	//   m.room.avatar
	//   m.room.create
	//   m.room.canonical_alias
	//   m.room.guest_access
	//   m.room.history_visibility
	//   m.room.join_rules
	//   m.room.member
	//   m.room.name
	//   m.room.topic
	// Any other tuple type will result in the query failing.
	StateTuples []gomatrixserverlib.StateKeyTuple
}

type QueryBulkStateContentResponse

type QueryBulkStateContentResponse struct {
	// map of room ID -> tuple -> content_value
	Rooms map[string]map[gomatrixserverlib.StateKeyTuple]string
}

func (*QueryBulkStateContentResponse) MarshalJSON

func (r *QueryBulkStateContentResponse) MarshalJSON() ([]byte, error)

MarshalJSON stringifies the room ID and StateKeyTuple keys so they can be sent over the wire in HTTP API mode.

func (*QueryBulkStateContentResponse) UnmarshalJSON

func (r *QueryBulkStateContentResponse) UnmarshalJSON(data []byte) error

type QueryCurrentStateRequest

type QueryCurrentStateRequest struct {
	RoomID      string
	StateTuples []gomatrixserverlib.StateKeyTuple
}

type QueryCurrentStateResponse

type QueryCurrentStateResponse struct {
	StateEvents map[gomatrixserverlib.StateKeyTuple]*gomatrixserverlib.HeaderedEvent
}

func (*QueryCurrentStateResponse) MarshalJSON

func (r *QueryCurrentStateResponse) MarshalJSON() ([]byte, error)

MarshalJSON stringifies the StateKeyTuple keys so they can be sent over the wire in HTTP API mode.

func (*QueryCurrentStateResponse) UnmarshalJSON

func (r *QueryCurrentStateResponse) UnmarshalJSON(data []byte) error

type QueryEventsByIDRequest

type QueryEventsByIDRequest struct {
	// The event IDs to look up.
	EventIDs []string `json:"event_ids"`
}

QueryEventsByIDRequest is a request to QueryEventsByID

type QueryEventsByIDResponse

type QueryEventsByIDResponse struct {
	// A list of events with the requested IDs.
	// If the roomserver does not have a copy of a requested event
	// then it will omit that event from the list.
	// If the roomserver thinks it has a copy of the event, but
	// fails to read it from the database then it will fail
	// the entire request.
	// This list will be in an arbitrary order.
	Events []*gomatrixserverlib.HeaderedEvent `json:"events"`
}

QueryEventsByIDResponse is a response to QueryEventsByID

type QueryKnownUsersRequest

type QueryKnownUsersRequest struct {
	UserID       string `json:"user_id"`
	SearchString string `json:"search_string"`
	Limit        int    `json:"limit"`
}

type QueryKnownUsersResponse

type QueryKnownUsersResponse struct {
	Users []authtypes.FullyQualifiedProfile `json:"profiles"`
}

type QueryLatestEventsAndStateRequest

type QueryLatestEventsAndStateRequest struct {
	// The room ID to query the latest events for.
	RoomID string `json:"room_id"`
	// The state key tuples to fetch from the room current state.
	// If this list is empty or nil then *ALL* current state events are returned.
	StateToFetch []gomatrixserverlib.StateKeyTuple `json:"state_to_fetch"`
}

QueryLatestEventsAndStateRequest is a request to QueryLatestEventsAndState

type QueryLatestEventsAndStateResponse

type QueryLatestEventsAndStateResponse struct {
	// Does the room exist?
	// If the room doesn't exist this will be false and LatestEvents will be empty.
	RoomExists bool `json:"room_exists"`
	// The room version of the room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// The latest events in the room.
	// These are used to set the prev_events when sending an event.
	LatestEvents []gomatrixserverlib.EventReference `json:"latest_events"`
	// The state events requested.
	// This list will be in an arbitrary order.
	// These are used to set the auth_events when sending an event.
	// These are used to check whether the event is allowed.
	StateEvents []*gomatrixserverlib.HeaderedEvent `json:"state_events"`
	// The depth of the latest events.
	// This is one greater than the maximum depth of the latest events.
	// This is used to set the depth when sending an event.
	Depth int64 `json:"depth"`
}

QueryLatestEventsAndStateResponse is a response to QueryLatestEventsAndState This is used when sending events to set the prev_events, auth_events and depth. It is also used to tell whether the event is allowed by the event auth rules.

type QueryMembershipForUserRequest

type QueryMembershipForUserRequest struct {
	// ID of the room to fetch membership from
	RoomID string `json:"room_id"`
	// ID of the user for whom membership is requested
	UserID string `json:"user_id"`
}

QueryMembershipForUserRequest is a request to QueryMembership

type QueryMembershipForUserResponse

type QueryMembershipForUserResponse struct {
	// The EventID of the latest "m.room.member" event for the sender,
	// if HasBeenInRoom is true.
	EventID string `json:"event_id"`
	// True if the user has been in room before and has either stayed in it or left it.
	HasBeenInRoom bool `json:"has_been_in_room"`
	// True if the user is in room.
	IsInRoom bool `json:"is_in_room"`
	// The current membership
	Membership string `json:"membership"`
	// True if the user asked to forget this room.
	IsRoomForgotten bool `json:"is_room_forgotten"`
}

QueryMembershipForUserResponse is a response to QueryMembership

type QueryMembershipsForRoomRequest

type QueryMembershipsForRoomRequest struct {
	// If true, only returns the membership events of "join" membership
	JoinedOnly bool `json:"joined_only"`
	// ID of the room to fetch memberships from
	RoomID string `json:"room_id"`
	// Optional - ID of the user sending the request, for checking if the
	// user is allowed to see the memberships. If not specified then all
	// room memberships will be returned.
	Sender string `json:"sender"`
}

QueryMembershipsForRoomRequest is a request to QueryMembershipsForRoom

type QueryMembershipsForRoomResponse

type QueryMembershipsForRoomResponse struct {
	// The "m.room.member" events (of "join" membership) in the client format
	JoinEvents []gomatrixserverlib.ClientEvent `json:"join_events"`
	// True if the user has been in room before and has either stayed in it or
	// left it.
	HasBeenInRoom bool `json:"has_been_in_room"`
	// True if the user asked to forget this room.
	IsRoomForgotten bool `json:"is_room_forgotten"`
}

QueryMembershipsForRoomResponse is a response to QueryMembershipsForRoom

type QueryMissingAuthPrevEventsRequest

type QueryMissingAuthPrevEventsRequest struct {
	// The room ID to query the state in.
	RoomID string `json:"room_id"`
	// The list of auth events to check the existence of.
	AuthEventIDs []string `json:"auth_event_ids"`
	// The list of previous events to check the existence of.
	PrevEventIDs []string `json:"prev_event_ids"`
}

type QueryMissingAuthPrevEventsResponse

type QueryMissingAuthPrevEventsResponse struct {
	// Does the room exist on this roomserver?
	// If the room doesn't exist all other fields will be empty.
	RoomExists bool `json:"room_exists"`
	// The room version of the room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// The event IDs of the auth events that we don't know locally.
	MissingAuthEventIDs []string `json:"missing_auth_event_ids"`
	// The event IDs of the previous events that we don't know locally.
	MissingPrevEventIDs []string `json:"missing_prev_event_ids"`
}

type QueryMissingEventsRequest

type QueryMissingEventsRequest struct {
	// Events which are known previous to the gap in the timeline.
	EarliestEvents []string `json:"earliest_events"`
	// Latest known events.
	LatestEvents []string `json:"latest_events"`
	// Limit the number of events this query returns.
	Limit int `json:"limit"`
	// The server interested in the event
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
}

QueryMissingEventsRequest is a request to QueryMissingEvents

type QueryMissingEventsResponse

type QueryMissingEventsResponse struct {
	// Missing events, arbritrary order.
	Events []*gomatrixserverlib.HeaderedEvent `json:"events"`
}

QueryMissingEventsResponse is a response to QueryMissingEvents

type QueryPublishedRoomsRequest

type QueryPublishedRoomsRequest struct {
	// Optional. If specified, returns whether this room is published or not.
	RoomID string
}

type QueryPublishedRoomsResponse

type QueryPublishedRoomsResponse struct {
	// The list of published rooms.
	RoomIDs []string
}

type QueryRoomVersionCapabilitiesRequest

type QueryRoomVersionCapabilitiesRequest struct{}

QueryRoomVersionCapabilitiesRequest asks for the default room version

type QueryRoomVersionCapabilitiesResponse

type QueryRoomVersionCapabilitiesResponse struct {
	DefaultRoomVersion    gomatrixserverlib.RoomVersion            `json:"default"`
	AvailableRoomVersions map[gomatrixserverlib.RoomVersion]string `json:"available"`
}

QueryRoomVersionCapabilitiesResponse is a response to QueryRoomVersionCapabilitiesRequest

type QueryRoomVersionForRoomRequest

type QueryRoomVersionForRoomRequest struct {
	RoomID string `json:"room_id"`
}

QueryRoomVersionForRoomRequest asks for the room version for a given room.

type QueryRoomVersionForRoomResponse

type QueryRoomVersionForRoomResponse struct {
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
}

QueryRoomVersionForRoomResponse is a response to QueryRoomVersionForRoomRequest

type QueryRoomsForUserRequest

type QueryRoomsForUserRequest struct {
	UserID string
	// The desired membership of the user. If this is the empty string then no rooms are returned.
	WantMembership string
}

type QueryRoomsForUserResponse

type QueryRoomsForUserResponse struct {
	RoomIDs []string
}

type QueryServerAllowedToSeeEventRequest

type QueryServerAllowedToSeeEventRequest struct {
	// The event ID to look up invites in.
	EventID string `json:"event_id"`
	// The server interested in the event
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
}

QueryServerAllowedToSeeEventRequest is a request to QueryServerAllowedToSeeEvent

type QueryServerAllowedToSeeEventResponse

type QueryServerAllowedToSeeEventResponse struct {
	// Wether the server in question is allowed to see the event
	AllowedToSeeEvent bool `json:"can_see_event"`
}

QueryServerAllowedToSeeEventResponse is a response to QueryServerAllowedToSeeEvent

type QueryServerBannedFromRoomRequest

type QueryServerBannedFromRoomRequest struct {
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
	RoomID     string                       `json:"room_id"`
}

type QueryServerBannedFromRoomResponse

type QueryServerBannedFromRoomResponse struct {
	Banned bool `json:"banned"`
}

type QueryServerJoinedToRoomRequest

type QueryServerJoinedToRoomRequest struct {
	// Server name of the server to find. If not specified, we will
	// default to checking if the local server is joined.
	ServerName gomatrixserverlib.ServerName `json:"server_name"`
	// ID of the room to see if we are still joined to
	RoomID string `json:"room_id"`
}

QueryServerJoinedToRoomRequest is a request to QueryServerJoinedToRoom

type QueryServerJoinedToRoomResponse

type QueryServerJoinedToRoomResponse struct {
	// True if the room exists on the server
	RoomExists bool `json:"room_exists"`
	// True if we still believe that the server is participating in the room
	IsInRoom bool `json:"is_in_room"`
}

QueryMembershipsForRoomResponse is a response to QueryServerJoinedToRoom

type QuerySharedUsersRequest

type QuerySharedUsersRequest struct {
	UserID         string
	ExcludeRoomIDs []string
	IncludeRoomIDs []string
}

type QuerySharedUsersResponse

type QuerySharedUsersResponse struct {
	UserIDsToCount map[string]int
}

type QueryStateAfterEventsRequest

type QueryStateAfterEventsRequest struct {
	// The room ID to query the state in.
	RoomID string `json:"room_id"`
	// The list of previous events to return the events after.
	PrevEventIDs []string `json:"prev_event_ids"`
	// The state key tuples to fetch from the state. If none are specified then
	// the entire resolved room state will be returned.
	StateToFetch []gomatrixserverlib.StateKeyTuple `json:"state_to_fetch"`
}

QueryStateAfterEventsRequest is a request to QueryStateAfterEvents

type QueryStateAfterEventsResponse

type QueryStateAfterEventsResponse struct {
	// Does the room exist on this roomserver?
	// If the room doesn't exist this will be false and StateEvents will be empty.
	RoomExists bool `json:"room_exists"`
	// The room version of the room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// Do all the previous events exist on this roomserver?
	// If some of previous events do not exist this will be false and StateEvents will be empty.
	PrevEventsExist bool `json:"prev_events_exist"`
	// The state events requested.
	// This list will be in an arbitrary order.
	StateEvents []*gomatrixserverlib.HeaderedEvent `json:"state_events"`
}

QueryStateAfterEventsResponse is a response to QueryStateAfterEvents

type QueryStateAndAuthChainRequest

type QueryStateAndAuthChainRequest struct {
	// The room ID to query the state in.
	RoomID string `json:"room_id"`
	// The list of prev events for the event. Used to calculate the state at
	// the event.
	PrevEventIDs []string `json:"prev_event_ids"`
	// The list of auth events for the event. Used to calculate the auth chain
	AuthEventIDs []string `json:"auth_event_ids"`
	// Should state resolution be ran on the result events?
	// TODO: check call sites and remove if we always want to do state res
	ResolveState bool `json:"resolve_state"`
}

QueryStateAndAuthChainRequest is a request to QueryStateAndAuthChain

type QueryStateAndAuthChainResponse

type QueryStateAndAuthChainResponse struct {
	// Does the room exist on this roomserver?
	// If the room doesn't exist this will be false and StateEvents will be empty.
	RoomExists bool `json:"room_exists"`
	// The room version of the room.
	RoomVersion gomatrixserverlib.RoomVersion `json:"room_version"`
	// Do all the previous events exist on this roomserver?
	// If some of previous events do not exist this will be false and StateEvents will be empty.
	PrevEventsExist bool `json:"prev_events_exist"`
	// The state and auth chain events that were requested.
	// The lists will be in an arbitrary order.
	StateEvents     []*gomatrixserverlib.HeaderedEvent `json:"state_events"`
	AuthChainEvents []*gomatrixserverlib.HeaderedEvent `json:"auth_chain_events"`
}

QueryStateAndAuthChainResponse is a response to QueryStateAndAuthChain

type RemoveRoomAliasRequest

type RemoveRoomAliasRequest struct {
	// ID of the user removing the alias
	UserID string `json:"user_id"`
	// The room alias to remove
	Alias string `json:"alias"`
}

RemoveRoomAliasRequest is a request to RemoveRoomAlias

type RemoveRoomAliasResponse

type RemoveRoomAliasResponse struct {
	// Did the alias exist before?
	Found bool `json:"found"`
	// Did we remove it?
	Removed bool `json:"removed"`
}

RemoveRoomAliasResponse is a response to RemoveRoomAlias

type RoomserverInternalAPI

type RoomserverInternalAPI interface {
	// needed to avoid chicken and egg scenario when setting up the
	// interdependencies between the roomserver and other input APIs
	SetFederationSenderAPI(fsAPI fsAPI.FederationSenderInternalAPI)
	SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI)

	InputRoomEvents(
		ctx context.Context,
		request *InputRoomEventsRequest,
		response *InputRoomEventsResponse,
	)

	PerformInvite(
		ctx context.Context,
		req *PerformInviteRequest,
		res *PerformInviteResponse,
	) error

	PerformJoin(
		ctx context.Context,
		req *PerformJoinRequest,
		res *PerformJoinResponse,
	)

	PerformLeave(
		ctx context.Context,
		req *PerformLeaveRequest,
		res *PerformLeaveResponse,
	) error

	PerformPeek(
		ctx context.Context,
		req *PerformPeekRequest,
		res *PerformPeekResponse,
	)

	PerformUnpeek(
		ctx context.Context,
		req *PerformUnpeekRequest,
		res *PerformUnpeekResponse,
	)

	PerformPublish(
		ctx context.Context,
		req *PerformPublishRequest,
		res *PerformPublishResponse,
	)

	PerformInboundPeek(
		ctx context.Context,
		req *PerformInboundPeekRequest,
		res *PerformInboundPeekResponse,
	) error

	QueryPublishedRooms(
		ctx context.Context,
		req *QueryPublishedRoomsRequest,
		res *QueryPublishedRoomsResponse,
	) error

	// Query the latest events and state for a room from the room server.
	QueryLatestEventsAndState(
		ctx context.Context,
		request *QueryLatestEventsAndStateRequest,
		response *QueryLatestEventsAndStateResponse,
	) error

	// Query the state after a list of events in a room from the room server.
	QueryStateAfterEvents(
		ctx context.Context,
		request *QueryStateAfterEventsRequest,
		response *QueryStateAfterEventsResponse,
	) error

	// Query whether the roomserver is missing any auth or prev events.
	QueryMissingAuthPrevEvents(
		ctx context.Context,
		request *QueryMissingAuthPrevEventsRequest,
		response *QueryMissingAuthPrevEventsResponse,
	) error

	// Query a list of events by event ID.
	QueryEventsByID(
		ctx context.Context,
		request *QueryEventsByIDRequest,
		response *QueryEventsByIDResponse,
	) error

	// Query the membership event for an user for a room.
	QueryMembershipForUser(
		ctx context.Context,
		request *QueryMembershipForUserRequest,
		response *QueryMembershipForUserResponse,
	) error

	// Query a list of membership events for a room
	QueryMembershipsForRoom(
		ctx context.Context,
		request *QueryMembershipsForRoomRequest,
		response *QueryMembershipsForRoomResponse,
	) error

	// Query if we think we're still in a room.
	QueryServerJoinedToRoom(
		ctx context.Context,
		request *QueryServerJoinedToRoomRequest,
		response *QueryServerJoinedToRoomResponse,
	) error

	// Query whether a server is allowed to see an event
	QueryServerAllowedToSeeEvent(
		ctx context.Context,
		request *QueryServerAllowedToSeeEventRequest,
		response *QueryServerAllowedToSeeEventResponse,
	) error

	// Query missing events for a room from roomserver
	QueryMissingEvents(
		ctx context.Context,
		request *QueryMissingEventsRequest,
		response *QueryMissingEventsResponse,
	) error

	// Query to get state and auth chain for a (potentially hypothetical) event.
	// Takes lists of PrevEventIDs and AuthEventsIDs and uses them to calculate
	// the state and auth chain to return.
	QueryStateAndAuthChain(
		ctx context.Context,
		request *QueryStateAndAuthChainRequest,
		response *QueryStateAndAuthChainResponse,
	) error

	// QueryAuthChain returns the entire auth chain for the event IDs given.
	// The response includes the events in the request.
	// Omits without error for any missing auth events. There will be no duplicates.
	QueryAuthChain(
		ctx context.Context,
		request *QueryAuthChainRequest,
		response *QueryAuthChainResponse,
	) error

	// QueryCurrentState retrieves the requested state events. If state events are not found, they will be missing from
	// the response.
	QueryCurrentState(ctx context.Context, req *QueryCurrentStateRequest, res *QueryCurrentStateResponse) error
	// QueryRoomsForUser retrieves a list of room IDs matching the given query.
	QueryRoomsForUser(ctx context.Context, req *QueryRoomsForUserRequest, res *QueryRoomsForUserResponse) error
	// QueryBulkStateContent does a bulk query for state event content in the given rooms.
	QueryBulkStateContent(ctx context.Context, req *QueryBulkStateContentRequest, res *QueryBulkStateContentResponse) error
	// QuerySharedUsers returns a list of users who share at least 1 room in common with the given user.
	QuerySharedUsers(ctx context.Context, req *QuerySharedUsersRequest, res *QuerySharedUsersResponse) error
	// QueryKnownUsers returns a list of users that we know about from our joined rooms.
	QueryKnownUsers(ctx context.Context, req *QueryKnownUsersRequest, res *QueryKnownUsersResponse) error
	// QueryServerBannedFromRoom returns whether a server is banned from a room by server ACLs.
	QueryServerBannedFromRoom(ctx context.Context, req *QueryServerBannedFromRoomRequest, res *QueryServerBannedFromRoomResponse) error

	// Query a given amount (or less) of events prior to a given set of events.
	PerformBackfill(
		ctx context.Context,
		request *PerformBackfillRequest,
		response *PerformBackfillResponse,
	) error

	// PerformForget forgets a rooms history for a specific user
	PerformForget(ctx context.Context, req *PerformForgetRequest, resp *PerformForgetResponse) error

	// Asks for the default room version as preferred by the server.
	QueryRoomVersionCapabilities(
		ctx context.Context,
		request *QueryRoomVersionCapabilitiesRequest,
		response *QueryRoomVersionCapabilitiesResponse,
	) error

	// Asks for the room version for a given room.
	QueryRoomVersionForRoom(
		ctx context.Context,
		request *QueryRoomVersionForRoomRequest,
		response *QueryRoomVersionForRoomResponse,
	) error

	// Set a room alias
	SetRoomAlias(
		ctx context.Context,
		req *SetRoomAliasRequest,
		response *SetRoomAliasResponse,
	) error

	// Get the room ID for an alias
	GetRoomIDForAlias(
		ctx context.Context,
		req *GetRoomIDForAliasRequest,
		response *GetRoomIDForAliasResponse,
	) error

	// Get all known aliases for a room ID
	GetAliasesForRoomID(
		ctx context.Context,
		req *GetAliasesForRoomIDRequest,
		response *GetAliasesForRoomIDResponse,
	) error

	// Get the user ID of the creator of an alias
	GetCreatorIDForAlias(
		ctx context.Context,
		req *GetCreatorIDForAliasRequest,
		response *GetCreatorIDForAliasResponse,
	) error

	// Remove a room alias
	RemoveRoomAlias(
		ctx context.Context,
		req *RemoveRoomAliasRequest,
		response *RemoveRoomAliasResponse,
	) error
}

RoomserverInputAPI is used to write events to the room server.

type RoomserverInternalAPITrace

type RoomserverInternalAPITrace struct {
	Impl RoomserverInternalAPI
}

RoomserverInternalAPITrace wraps a RoomserverInternalAPI and logs the complete request/response/error

func (*RoomserverInternalAPITrace) GetAliasesForRoomID

func (*RoomserverInternalAPITrace) GetCreatorIDForAlias

func (*RoomserverInternalAPITrace) GetRoomIDForAlias

func (*RoomserverInternalAPITrace) InputRoomEvents

func (*RoomserverInternalAPITrace) PerformBackfill

func (*RoomserverInternalAPITrace) PerformForget added in v0.3.0

func (*RoomserverInternalAPITrace) PerformInboundPeek added in v0.3.7

func (*RoomserverInternalAPITrace) PerformInvite

func (*RoomserverInternalAPITrace) PerformJoin

func (*RoomserverInternalAPITrace) PerformLeave

func (*RoomserverInternalAPITrace) PerformPeek

func (*RoomserverInternalAPITrace) PerformPublish

func (*RoomserverInternalAPITrace) PerformUnpeek added in v0.3.3

func (*RoomserverInternalAPITrace) QueryAuthChain added in v0.3.3

func (t *RoomserverInternalAPITrace) QueryAuthChain(
	ctx context.Context,
	request *QueryAuthChainRequest,
	response *QueryAuthChainResponse,
) error

func (*RoomserverInternalAPITrace) QueryBulkStateContent

QueryBulkStateContent does a bulk query for state event content in the given rooms.

func (*RoomserverInternalAPITrace) QueryCurrentState

func (*RoomserverInternalAPITrace) QueryEventsByID

func (*RoomserverInternalAPITrace) QueryKnownUsers

QueryKnownUsers returns a list of users that we know about from our joined rooms.

func (*RoomserverInternalAPITrace) QueryLatestEventsAndState

func (*RoomserverInternalAPITrace) QueryMembershipForUser

func (*RoomserverInternalAPITrace) QueryMembershipsForRoom

func (*RoomserverInternalAPITrace) QueryMissingAuthPrevEvents

func (*RoomserverInternalAPITrace) QueryMissingEvents

func (*RoomserverInternalAPITrace) QueryPublishedRooms

func (*RoomserverInternalAPITrace) QueryRoomVersionCapabilities

func (*RoomserverInternalAPITrace) QueryRoomVersionForRoom

func (*RoomserverInternalAPITrace) QueryRoomsForUser

QueryRoomsForUser retrieves a list of room IDs matching the given query.

func (*RoomserverInternalAPITrace) QueryServerAllowedToSeeEvent

func (*RoomserverInternalAPITrace) QueryServerBannedFromRoom

QueryServerBannedFromRoom returns whether a server is banned from a room by server ACLs.

func (*RoomserverInternalAPITrace) QueryServerJoinedToRoom

func (*RoomserverInternalAPITrace) QuerySharedUsers

QuerySharedUsers returns a list of users who share at least 1 room in common with the given user.

func (*RoomserverInternalAPITrace) QueryStateAfterEvents

func (*RoomserverInternalAPITrace) QueryStateAndAuthChain

func (*RoomserverInternalAPITrace) RemoveRoomAlias

func (*RoomserverInternalAPITrace) SetAppserviceAPI added in v0.3.4

func (t *RoomserverInternalAPITrace) SetAppserviceAPI(asAPI asAPI.AppServiceQueryAPI)

func (*RoomserverInternalAPITrace) SetFederationSenderAPI

func (t *RoomserverInternalAPITrace) SetFederationSenderAPI(fsAPI fsAPI.FederationSenderInternalAPI)

func (*RoomserverInternalAPITrace) SetRoomAlias

type SetRoomAliasRequest

type SetRoomAliasRequest struct {
	// ID of the user setting the alias
	UserID string `json:"user_id"`
	// New alias for the room
	Alias string `json:"alias"`
	// The room ID the alias is referring to
	RoomID string `json:"room_id"`
}

SetRoomAliasRequest is a request to SetRoomAlias

type SetRoomAliasResponse

type SetRoomAliasResponse struct {
	// Does the alias already refer to a room?
	AliasExists bool `json:"alias_exists"`
}

SetRoomAliasResponse is a response to SetRoomAlias

type TransactionID

type TransactionID struct {
	SessionID     int64  `json:"session_id"`
	TransactionID string `json:"id"`
}

TransactionID contains the transaction ID sent by a client when sending an event, along with the ID of the client session.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL