MCPcopy Create free account
hub / github.com/daodst/chat / LoadStateAfterEventsForStringTuples

Method LoadStateAfterEventsForStringTuples

roomserver/state/state.go:403–416  ·  view source on GitHub ↗

LoadStateAfterEventsForStringTuples loads the state for a list of event type and state key pairs after list of events. This is used when we only want to load a subset of the room state after a list of events. If there is no entry for a given event type and state key pair then it will be discarded. T

(
	ctx context.Context,
	prevStates []types.StateAtEvent,
	stateKeyTuples []gomatrixserverlib.StateKeyTuple,
)

Source from the content-addressed store, hash-verified

401// This is typically the state before an event.
402// Returns a sorted list of state entries or an error if there was a problem talking to the database.
403func (v *StateResolution) LoadStateAfterEventsForStringTuples(
404 ctx context.Context,
405 prevStates []types.StateAtEvent,
406 stateKeyTuples []gomatrixserverlib.StateKeyTuple,
407) ([]types.StateEntry, error) {
408 span, ctx := opentracing.StartSpanFromContext(ctx, "StateResolution.LoadStateAfterEventsForStringTuples")
409 defer span.Finish()
410
411 numericTuples, err := v.stringTuplesToNumericTuples(ctx, stateKeyTuples)
412 if err != nil {
413 return nil, err
414 }
415 return v.loadStateAfterEventsForNumericTuples(ctx, prevStates, numericTuples)
416}
417
418func (v *StateResolution) loadStateAfterEventsForNumericTuples(
419 ctx context.Context,

Callers 1

QueryStateAfterEventsMethod · 0.95

Tested by

no test coverage detected