diff options
author | Neil Alexander <neilalexander@users.noreply.github.com> | 2020-04-16 12:53:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 12:53:27 +0100 |
commit | 3110a819960dec0b4c1b70474186b7e40a2be59a (patch) | |
tree | 7d709d8013670fb7c075fdfd7266d74db5a70461 /roomserver | |
parent | c1bca95adbe04a17d8feb91aa24dde9c4cffb1fb (diff) |
Set default room version to 4 (#957)
* Set default room version to 4
* Default to v1 when room_version key missing
Signed-off-by: Alex Chen <minecnly@gmail.com>
* Squashed commit of the following:
commit c1bca95adbe04a17d8feb91aa24dde9c4cffb1fb
Author: Kegsay <kegan@matrix.org>
Date: Thu Apr 16 10:06:55 2020 +0100
Add SQL tracing via DENDRITE_TRACE_SQL (#968)
* Add SQL tracing via DENDRITE_TRACE_SQL
Add this to `internal/sqlutil` in preparation for #897
* Not entirely
commit c2ea96190944d8e39b0c200e43b1eedfeeeb49a6
Author: Kegsay <kegan@matrix.org>
Date: Wed Apr 15 17:48:40 2020 +0100
Add HTTP trace logging (#965)
* Dump all requests/response server-side
* Wrap in DENDRITE_TRACE
* DENDRITE_TRACE_HTTP is better
* Bugfix for response body and linting
* False is true and true is false
* Linting
* How did this get missed
* More linting
* Update gomatrixserverlib
* Remove unneeded imports
Co-authored-by: Cnly <minecnly@gmail.com>
Diffstat (limited to 'roomserver')
-rw-r--r-- | roomserver/storage/postgres/storage.go | 3 | ||||
-rw-r--r-- | roomserver/storage/sqlite3/storage.go | 3 | ||||
-rw-r--r-- | roomserver/version/version.go | 2 |
3 files changed, 3 insertions, 5 deletions
diff --git a/roomserver/storage/postgres/storage.go b/roomserver/storage/postgres/storage.go index a33bed8f..6f2b9661 100644 --- a/roomserver/storage/postgres/storage.go +++ b/roomserver/storage/postgres/storage.go @@ -21,7 +21,6 @@ import ( "encoding/json" "github.com/matrix-org/dendrite/internal/sqlutil" - roomserverVersion "github.com/matrix-org/dendrite/roomserver/version" // Import the postgres database driver. _ "github.com/lib/pq" @@ -147,7 +146,7 @@ func extractRoomVersionFromCreateEvent(event gomatrixserverlib.Event) ( if event.Type() != gomatrixserverlib.MRoomCreate { return gomatrixserverlib.RoomVersion(""), nil } - roomVersion = roomserverVersion.DefaultRoomVersion() + roomVersion = gomatrixserverlib.RoomVersionV1 var createContent gomatrixserverlib.CreateContent // The m.room.create event contains an optional "room_version" key in // the event content, so we need to unmarshal that first. diff --git a/roomserver/storage/sqlite3/storage.go b/roomserver/storage/sqlite3/storage.go index 6f594430..444a8fdd 100644 --- a/roomserver/storage/sqlite3/storage.go +++ b/roomserver/storage/sqlite3/storage.go @@ -23,7 +23,6 @@ import ( "net/url" "github.com/matrix-org/dendrite/internal/sqlutil" - roomserverVersion "github.com/matrix-org/dendrite/roomserver/version" "github.com/matrix-org/dendrite/common" "github.com/matrix-org/dendrite/roomserver/api" @@ -176,7 +175,7 @@ func extractRoomVersionFromCreateEvent(event gomatrixserverlib.Event) ( if event.Type() != gomatrixserverlib.MRoomCreate { return gomatrixserverlib.RoomVersion(""), nil } - roomVersion = roomserverVersion.DefaultRoomVersion() + roomVersion = gomatrixserverlib.RoomVersionV1 var createContent gomatrixserverlib.CreateContent // The m.room.create event contains an optional "room_version" key in // the event content, so we need to unmarshal that first. diff --git a/roomserver/version/version.go b/roomserver/version/version.go index e60b5ef7..f2a67e74 100644 --- a/roomserver/version/version.go +++ b/roomserver/version/version.go @@ -59,7 +59,7 @@ var roomVersions = map[gomatrixserverlib.RoomVersion]RoomVersionDescription{ // DefaultRoomVersion contains the room version that will, by // default, be used to create new rooms on this server. func DefaultRoomVersion() gomatrixserverlib.RoomVersion { - return gomatrixserverlib.RoomVersionV2 + return gomatrixserverlib.RoomVersionV4 } // RoomVersions returns a map of all known room versions to this |