From 61437d6e444bdad01aba18985413b3fd5f1ba4b4 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 21 Jan 2022 11:14:19 +0000 Subject: [PATCH] Try that again --- roomserver/internal/query/query.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/roomserver/internal/query/query.go b/roomserver/internal/query/query.go index b9eac3395..626e80473 100644 --- a/roomserver/internal/query/query.go +++ b/roomserver/internal/query/query.go @@ -149,12 +149,8 @@ func (r *Queryer) QueryMissingAuthPrevEvents( } for _, prevEventID := range request.PrevEventIDs { - if eventTypes, err := r.DB.EventTypeNIDs(ctx, []string{prevEventID}); err != nil || len(eventTypes) == 0 { - response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID) - } else if eventTypes[prevEventID] != types.MRoomCreateNID { - // We only want to check for missing state for events that aren't create - // events, because there is no state before a create event - if state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID}); err != nil || len(state) == 0 { + if state, err := r.DB.StateAtEventIDs(ctx, []string{prevEventID}); err != nil || len(state) == 0 { + if state[0].EventTypeNID != types.MRoomCreateNID { response.MissingPrevEventIDs = append(response.MissingPrevEventIDs, prevEventID) } }