query

package
v0.13.7 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthChain added in v0.3.7

func GetAuthChain(
	ctx context.Context, fn eventsFromIDs, roomInfo *types.RoomInfo, authEventIDs []string,
) ([]gomatrixserverlib.PDU, error)

GetAuthChain fetches the auth chain for the given auth events. An auth chain is the list of all events that are referenced in the auth_events section, and all their auth_events, recursively. The returned set of events contain the given events. Will *not* error if we don't have all auth events.

Types

type Queryer

type Queryer struct {
	DB                storage.Database
	Cache             caching.RoomServerCaches
	IsLocalServerName func(spec.ServerName) bool
	ServerACLs        *acls.ServerACLs
	Cfg               *config.Dendrite
	FSAPI             fsAPI.RoomserverFederationAPI
}

func (*Queryer) CurrentStateEvent added in v0.13.0

func (r *Queryer) CurrentStateEvent(ctx context.Context, roomID spec.RoomID, eventType string, stateKey string) (gomatrixserverlib.PDU, error)

func (*Queryer) InvitePending added in v0.13.0

func (r *Queryer) InvitePending(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID) (bool, error)

func (*Queryer) JoinedUserCount added in v0.13.2

func (r *Queryer) JoinedUserCount(ctx context.Context, roomID string) (int, error)

func (*Queryer) LocallyJoinedUsers added in v0.13.0

func (r *Queryer) LocallyJoinedUsers(ctx context.Context, roomVersion gomatrixserverlib.RoomVersion, roomNID types.RoomNID) ([]gomatrixserverlib.PDU, error)

func (*Queryer) QueryAdminEventReport added in v0.13.7

func (r *Queryer) QueryAdminEventReport(ctx context.Context, reportID uint64) (api.QueryAdminEventReportResponse, error)

QueryAdminEventReport returns a single event report.

func (*Queryer) QueryAdminEventReports added in v0.13.7

func (r *Queryer) QueryAdminEventReports(ctx context.Context, from uint64, limit uint64, backwards bool, userID, roomID string) ([]api.QueryAdminEventReportsResponse, int64, error)

QueryAdminEventReports returns event reports given a filter.

func (*Queryer) QueryAuthChain added in v0.3.3

func (r *Queryer) QueryAuthChain(ctx context.Context, req *api.QueryAuthChainRequest, res *api.QueryAuthChainResponse) error

func (*Queryer) QueryBulkStateContent

func (*Queryer) QueryCurrentState

func (r *Queryer) QueryCurrentState(ctx context.Context, req *api.QueryCurrentStateRequest, res *api.QueryCurrentStateResponse) error

func (*Queryer) QueryEventsByID

func (r *Queryer) QueryEventsByID(
	ctx context.Context,
	request *api.QueryEventsByIDRequest,
	response *api.QueryEventsByIDResponse,
) error

QueryEventsByID queries a list of events by event ID for one room. If no room is specified, it will try to determine which room to use by querying the first events roomID.

func (*Queryer) QueryKnownUsers

func (r *Queryer) QueryKnownUsers(ctx context.Context, req *api.QueryKnownUsersRequest, res *api.QueryKnownUsersResponse) error

func (*Queryer) QueryLatestEventsAndState

func (r *Queryer) QueryLatestEventsAndState(
	ctx context.Context,
	request *api.QueryLatestEventsAndStateRequest,
	response *api.QueryLatestEventsAndStateResponse,
) error

QueryLatestEventsAndState implements api.RoomserverInternalAPI

func (*Queryer) QueryLeftUsers added in v0.10.9

func (r *Queryer) QueryLeftUsers(ctx context.Context, req *api.QueryLeftUsersRequest, res *api.QueryLeftUsersResponse) error

func (*Queryer) QueryMembershipAtEvent added in v0.9.2

func (r *Queryer) QueryMembershipAtEvent(
	ctx context.Context,
	roomID spec.RoomID,
	eventIDs []string,
	senderID spec.SenderID,
) (map[string]*types.HeaderedEvent, error)

QueryMembershipAtEvent returns the known memberships at a given event. If the state before an event is not known, an empty list will be returned for that event instead.

Returned map from eventID to membership event. Events that do not have known state will return a nil event, resulting in a "leave" membership when calculating history visibility.

func (*Queryer) QueryMembershipForSenderID added in v0.13.0

func (r *Queryer) QueryMembershipForSenderID(
	ctx context.Context,
	roomID spec.RoomID,
	senderID spec.SenderID,
	response *api.QueryMembershipForUserResponse,
) error

QueryMembershipForSenderID implements api.RoomserverInternalAPI

func (*Queryer) QueryMembershipForUser

func (r *Queryer) QueryMembershipForUser(
	ctx context.Context,
	request *api.QueryMembershipForUserRequest,
	response *api.QueryMembershipForUserResponse,
) error

QueryMembershipForUser implements api.RoomserverInternalAPI

func (*Queryer) QueryMembershipsForRoom

func (r *Queryer) QueryMembershipsForRoom(
	ctx context.Context,
	request *api.QueryMembershipsForRoomRequest,
	response *api.QueryMembershipsForRoomResponse,
) error

QueryMembershipsForRoom implements api.RoomserverInternalAPI

func (*Queryer) QueryMissingEvents

func (r *Queryer) QueryMissingEvents(
	ctx context.Context,
	request *api.QueryMissingEventsRequest,
	response *api.QueryMissingEventsResponse,
) error

QueryMissingEvents implements api.RoomserverInternalAPI

func (*Queryer) QueryNextRoomHierarchyPage added in v0.13.2

func (querier *Queryer) QueryNextRoomHierarchyPage(ctx context.Context, walker roomserver.RoomHierarchyWalker, limit int) (
	[]fclient.RoomHierarchyRoom,
	[]string,
	*roomserver.RoomHierarchyWalker,
	error,
)

Traverse the room hierarchy using the provided walker up to the provided limit, returning a new walker which can be used to fetch the next page.

If limit is -1, this is treated as no limit, and the entire hierarchy will be traversed.

If returned walker is nil, then there are no more rooms left to traverse. This method does not modify the provided walker, so it can be cached.

func (*Queryer) QueryPublishedRooms

func (r *Queryer) QueryPublishedRooms(
	ctx context.Context,
	req *api.QueryPublishedRoomsRequest,
	res *api.QueryPublishedRoomsResponse,
) error

func (*Queryer) QueryRestrictedJoinAllowed added in v0.8.6

func (r *Queryer) QueryRestrictedJoinAllowed(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID) (string, error)

nolint:gocyclo

func (*Queryer) QueryRoomInfo added in v0.13.0

func (r *Queryer) QueryRoomInfo(ctx context.Context, roomID spec.RoomID) (*types.RoomInfo, error)

func (*Queryer) QueryRoomVersionForRoom

func (r *Queryer) QueryRoomVersionForRoom(ctx context.Context, roomID string) (gomatrixserverlib.RoomVersion, error)

QueryRoomVersionForRoom implements api.RoomserverInternalAPI

func (*Queryer) QueryRoomsForUser

func (r *Queryer) QueryRoomsForUser(ctx context.Context, userID spec.UserID, desiredMembership string) ([]spec.RoomID, error)

func (*Queryer) QuerySenderIDForUser added in v0.13.0

func (r *Queryer) QuerySenderIDForUser(ctx context.Context, roomID spec.RoomID, userID spec.UserID) (*spec.SenderID, error)

func (*Queryer) QueryServerAllowedToSeeEvent

func (r *Queryer) QueryServerAllowedToSeeEvent(
	ctx context.Context,
	serverName spec.ServerName,
	eventID string,
	roomID string,
) (allowed bool, err error)

QueryServerAllowedToSeeEvent implements api.RoomserverInternalAPI

func (*Queryer) QueryServerJoinedToRoom

func (r *Queryer) QueryServerJoinedToRoom(
	ctx context.Context,
	request *api.QueryServerJoinedToRoomRequest,
	response *api.QueryServerJoinedToRoomResponse,
) error

QueryServerJoinedToRoom implements api.RoomserverInternalAPI

func (*Queryer) QuerySharedUsers

func (r *Queryer) QuerySharedUsers(ctx context.Context, req *api.QuerySharedUsersRequest, res *api.QuerySharedUsersResponse) error

func (*Queryer) QueryStateAfterEvents

func (r *Queryer) QueryStateAfterEvents(
	ctx context.Context,
	request *api.QueryStateAfterEventsRequest,
	response *api.QueryStateAfterEventsResponse,
) error

QueryStateAfterEvents implements api.RoomserverInternalAPI

func (*Queryer) QueryStateAndAuthChain

func (r *Queryer) QueryStateAndAuthChain(
	ctx context.Context,
	request *api.QueryStateAndAuthChainRequest,
	response *api.QueryStateAndAuthChainResponse,
) error

QueryStateAndAuthChain implements api.RoomserverInternalAPI

func (*Queryer) QueryUserIDForSender added in v0.13.0

func (r *Queryer) QueryUserIDForSender(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID) (*spec.UserID, error)

func (*Queryer) RestrictedRoomJoinInfo added in v0.13.0

func (r *Queryer) RestrictedRoomJoinInfo(ctx context.Context, roomID spec.RoomID, senderID spec.SenderID, localServerName spec.ServerName) (*gomatrixserverlib.RestrictedRoomJoinInfo, error)

func (*Queryer) RoomsWithACLs added in v0.13.7

func (r *Queryer) RoomsWithACLs(ctx context.Context) ([]string, error)

RoomsWithACLs returns all room IDs for rooms with ACLs

func (*Queryer) UserJoinedToRoom added in v0.13.0

func (r *Queryer) UserJoinedToRoom(ctx context.Context, roomNID types.RoomNID, senderID spec.SenderID) (bool, error)

Jump to

Keyboard shortcuts

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