diff options
author | devonh <devon.dmytro@gmail.com> | 2023-05-08 19:25:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 19:25:44 +0000 |
commit | a49c9f01e227aeb12aa2f27d5bf1915453c23a3b (patch) | |
tree | e8de0a2dcb4f5f57094dd9024cc6b94793a080ae /roomserver/internal/helpers/auth.go | |
parent | 2b34f88fde6b3aa633c8f23ff424a5db4951efd3 (diff) |
Only require room version instead of room info for db.Events() (#3079)
This reduces the API requirements for the Events database to align with
what is actually required.
Diffstat (limited to 'roomserver/internal/helpers/auth.go')
-rw-r--r-- | roomserver/internal/helpers/auth.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/roomserver/internal/helpers/auth.go b/roomserver/internal/helpers/auth.go index 3d2beab3..24958091 100644 --- a/roomserver/internal/helpers/auth.go +++ b/roomserver/internal/helpers/auth.go @@ -219,7 +219,12 @@ func loadAuthEvents( eventNIDs = append(eventNIDs, eventNID) } } - if result.events, err = db.Events(ctx, roomInfo, eventNIDs); err != nil { + + if roomInfo == nil { + err = types.ErrorInvalidRoomInfo + return + } + if result.events, err = db.Events(ctx, roomInfo.RoomVersion, eventNIDs); err != nil { return } roomID := "" |