mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-14 13:22:26 +03:00
Get room versions from database (#918)
* Retrieve room version where known in roomserver * Get room versions in alias code * Increase gocyclothreshold to 13, since we hit that number a lot * Remove gocyclo nolint from StoreEvent * Update interface to get room version from room ID instead of NID * Remove new API * Fixed this query for SQLite but not for Postgres
This commit is contained in:
parent
1467cc10d8
commit
c2bd0b97b3
11 changed files with 68 additions and 45 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
|
||||
appserviceAPI "github.com/matrix-org/dendrite/appservice/api"
|
||||
roomserverAPI "github.com/matrix-org/dendrite/roomserver/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
type MockRoomserverAliasAPIDatabase struct {
|
||||
|
@ -49,6 +50,12 @@ func (db *MockRoomserverAliasAPIDatabase) GetCreatorIDForAlias(
|
|||
return "", nil
|
||||
}
|
||||
|
||||
func (db *MockRoomserverAliasAPIDatabase) GetRoomVersionForRoom(
|
||||
ctx context.Context, roomID string,
|
||||
) (gomatrixserverlib.RoomVersion, error) {
|
||||
return gomatrixserverlib.RoomVersionV1, nil
|
||||
}
|
||||
|
||||
// This method needs to change depending on test case
|
||||
func (db *MockRoomserverAliasAPIDatabase) GetRoomIDForAlias(
|
||||
ctx context.Context,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue