Documentation ¶
Index ¶
- func CheckAuthEvents(ctx context.Context, db storage.Database, ...) ([]types.EventNID, error)
- func CheckForSoftFail(ctx context.Context, db storage.Database, ...) (bool, error)
- func CheckServerAllowedToSeeEvent(ctx context.Context, db storage.Database, info *types.RoomInfo, eventID string, ...) (bool, error)
- func GetMembershipsAtState(ctx context.Context, db storage.Database, stateEntries []types.StateEntry, ...) ([]types.Event, error)
- func IsInvitePending(ctx context.Context, db storage.Database, roomID, userID string) (bool, string, string, error)
- func IsServerCurrentlyInRoom(ctx context.Context, db storage.Database, ...) (bool, error)
- func LoadEvents(ctx context.Context, db storage.Database, eventNIDs []types.EventNID) ([]*gomatrixserverlib.Event, error)
- func LoadStateEvents(ctx context.Context, db storage.Database, stateEntries []types.StateEntry) ([]*gomatrixserverlib.Event, error)
- func QueryLatestEventsAndState(ctx context.Context, db storage.Database, ...) error
- func ScanEventTree(ctx context.Context, db storage.Database, info *types.RoomInfo, front []string, ...) ([]types.EventNID, 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 CheckAuthEvents ¶
func CheckAuthEvents( ctx context.Context, db storage.Database, event *gomatrixserverlib.HeaderedEvent, authEventIDs []string, ) ([]types.EventNID, error)
CheckAuthEvents checks that the event passes authentication checks Returns the numeric IDs for the auth events.
func CheckForSoftFail ¶
func CheckForSoftFail( ctx context.Context, db storage.Database, event *gomatrixserverlib.HeaderedEvent, stateEventIDs []string, ) (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 GetMembershipsAtState ¶
func GetMembershipsAtState( ctx context.Context, db storage.Database, 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, serverName gomatrixserverlib.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.Database, stateEntries []types.StateEntry, ) ([]*gomatrixserverlib.Event, error)
func QueryLatestEventsAndState ¶
func QueryLatestEventsAndState( ctx context.Context, db storage.Database, 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 gomatrixserverlib.ServerName, ) ([]types.EventNID, 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)