Bugfix and remove another needless query

This commit is contained in:
Kegan Dougal 2020-08-28 18:41:00 +01:00
parent 63c0819e65
commit cd7ab95dfe
2 changed files with 4 additions and 5 deletions

View file

@ -208,13 +208,9 @@ func buildInviteStrippedState(
StateKey: "",
})
}
_, currentStateSnapshotNID, _, err := db.LatestEventIDs(ctx, info.RoomNID)
if err != nil {
return nil, err
}
roomState := state.NewStateResolution(db)
stateEntries, err := roomState.LoadStateAtSnapshotForStringTuples(
ctx, currentStateSnapshotNID, stateWanted,
ctx, info.StateSnapshotNID, stateWanted,
)
if err != nil {
return nil, err

View file

@ -559,6 +559,9 @@ func (r *RoomserverInternalAPI) isServerCurrentlyInRoom(ctx context.Context, ser
if err != nil {
return false, err
}
if info == nil {
return false, fmt.Errorf("unknown room %s", roomID)
}
eventNIDs, err := r.DB.GetMembershipEventNIDsForRoom(ctx, info.RoomNID, true, false)
if err != nil {