This commit is contained in:
Kegan Dougal 2022-01-06 16:30:22 +00:00
parent 7d02f8ce2f
commit b40d89fc1f
2 changed files with 3 additions and 2 deletions

View file

@ -226,7 +226,7 @@ type QueryStateAndAuthChainRequest struct {
PrevEventIDs []string `json:"prev_event_ids"`
// The list of auth events for the event. Used to calculate the auth chain
AuthEventIDs []string `json:"auth_event_ids"`
// If true, the auth chain events for the authh event IDs given will be fetched only. Prev event IDs are ignored.
// If true, the auth chain events for the auth event IDs given will be fetched only. Prev event IDs are ignored.
// If false, state and auth chain events for the prev event IDs and entire current state will be included.
// TODO: not a great API shape. It serves 2 main uses: false=>response for send_join, true=>response for /event_auth
OnlyFetchAuthChain bool `json:"only_fetch_auth_chain"`

View file

@ -461,7 +461,8 @@ func (r *Queryer) QueryStateAndAuthChain(
// the entire current state of the room
// TODO: this probably means it should be a different query operation...
if request.OnlyFetchAuthChain {
authEvents, err := GetAuthChain(ctx, r.DB.EventsFromIDs, request.AuthEventIDs)
var authEvents []*gomatrixserverlib.Event
authEvents, err = GetAuthChain(ctx, r.DB.EventsFromIDs, request.AuthEventIDs)
if err != nil {
return err
}