Documentation ¶
Index ¶
- func CheckForSoftFail(ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, ...) (bool, error)
- func CheckServerAllowedToSeeEvent(ctx context.Context, db storage.Database, info *types.RoomInfo, roomID string, ...) (bool, error)
- func GetAuthEvents(ctx context.Context, db storage.RoomDatabase, ...) (gomatrixserverlib.AuthEventProvider, error)
- func GetMembershipsAtState(ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, ...) ([]types.Event, error)
- func IsInvitePending(ctx context.Context, db storage.Database, roomID string, ...) (bool, spec.SenderID, string, gomatrixserverlib.PDU, error)
- func IsServerCurrentlyInRoom(ctx context.Context, db storage.Database, querier api.QuerySenderIDAPI, ...) (bool, error)
- func LoadEvents(ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, ...) ([]gomatrixserverlib.PDU, error)
- func LoadStateEvents(ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, ...) ([]gomatrixserverlib.PDU, error)
- func MembershipAtEvent(ctx context.Context, db storage.RoomDatabase, info *types.RoomInfo, ...) (map[string][]types.StateEntry, error)
- func QueryLatestEventsAndState(ctx context.Context, db storage.Database, querier api.QuerySenderIDAPI, ...) error
- func ScanEventTree(ctx context.Context, db storage.Database, info *types.RoomInfo, front []string, ...) ([]types.EventNID, map[string]struct{}, error)
- func StateBeforeEvent(ctx context.Context, db storage.Database, info *types.RoomInfo, ...) ([]types.StateEntry, error)
- func UpdateToInviteMembership(mu *shared.MembershipUpdater, add *types.Event, updates []api.OutputEvent, ...) ([]api.OutputEvent, error)
- type EventMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForSoftFail ¶
func CheckForSoftFail( ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, event *types.HeaderedEvent, stateEventIDs []string, querier api.QuerySenderIDAPI, ) (bool, error)
CheckForSoftFail returns true if the event should be soft-failed and false otherwise. The return error value should be checked before the soft-fail bool.
func GetAuthEvents ¶
func GetAuthEvents( ctx context.Context, db storage.RoomDatabase, roomVersion gomatrixserverlib.RoomVersion, event gomatrixserverlib.PDU, authEventIDs []string, ) (gomatrixserverlib.AuthEventProvider, error)
GetAuthEvents returns the numeric IDs for the auth events.
func GetMembershipsAtState ¶
func GetMembershipsAtState( ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, stateEntries []types.StateEntry, joinedOnly bool, ) ([]types.Event, error)
GetMembershipsAtState filters the state events to only keep the "m.room.member" events with a "join" membership. These events are returned. Returns an error if there was an issue fetching the events.
func IsInvitePending ¶
func IsServerCurrentlyInRoom ¶
func IsServerCurrentlyInRoom(ctx context.Context, db storage.Database, querier api.QuerySenderIDAPI, serverName spec.ServerName, roomID string) (bool, error)
IsServerCurrentlyInRoom checks if a server is in a given room, based on the room memberships. If the servername is not supplied then the local server will be checked instead using a faster code path. TODO: This should probably be replaced by an API call.
func LoadEvents ¶
func LoadStateEvents ¶
func LoadStateEvents( ctx context.Context, db storage.RoomDatabase, roomInfo *types.RoomInfo, stateEntries []types.StateEntry, ) ([]gomatrixserverlib.PDU, error)
func MembershipAtEvent ¶
func MembershipAtEvent(ctx context.Context, db storage.RoomDatabase, info *types.RoomInfo, eventIDs []string, stateKeyNID types.EventStateKeyNID, querier api.QuerySenderIDAPI) (map[string][]types.StateEntry, error)
func QueryLatestEventsAndState ¶
func QueryLatestEventsAndState( ctx context.Context, db storage.Database, querier api.QuerySenderIDAPI, request *api.QueryLatestEventsAndStateRequest, response *api.QueryLatestEventsAndStateResponse, ) error
func ScanEventTree ¶
func ScanEventTree( ctx context.Context, db storage.Database, info *types.RoomInfo, front []string, visited map[string]bool, limit int, serverName spec.ServerName, querier api.QuerySenderIDAPI, ) ([]types.EventNID, map[string]struct{}, error)
TODO: Remove this when we have tests to assert correctness of this function
func StateBeforeEvent ¶
func UpdateToInviteMembership ¶
func UpdateToInviteMembership( mu *shared.MembershipUpdater, add *types.Event, updates []api.OutputEvent, roomVersion gomatrixserverlib.RoomVersion, ) ([]api.OutputEvent, error)