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, )
| 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. |
| 403 | func (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 | |
| 418 | func (v *StateResolution) loadStateAfterEventsForNumericTuples( |
| 419 | ctx context.Context, |
no test coverage detected