Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Set default room version to 4 (#957)
Browse files Browse the repository at this point in the history
* Set default room version to 4

* Default to v1 when room_version key missing

Signed-off-by: Alex Chen <[email protected]>

* Squashed commit of the following:

commit c1bca95
Author: Kegsay <[email protected]>
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 c2ea961
Author: Kegsay <[email protected]>
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 <[email protected]>
  • Loading branch information
neilalexander and Cnly authored Apr 16, 2020
1 parent c1bca95 commit 3110a81
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require (
github.com/matrix-org/go-http-js-libp2p v0.0.0-20200318135427-31631a9ef51f
github.com/matrix-org/go-sqlite3-js v0.0.0-20200325174927-327088cdef10
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26
github.com/matrix-org/gomatrixserverlib v0.0.0-20200415145257-d492cd4be836
github.com/matrix-org/gomatrixserverlib v0.0.0-20200416113012-dafb32a889ea
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1
github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7
github.com/mattn/go-sqlite3 v2.0.3+incompatible
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 h1:Hr3zjRsq2bh
github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5 h1:kmRjpmFOenVpOaV/DRlo9p6z/IbOKlUC+hhKsAAh8Qg=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200124100636-0c2ec91d1df5/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200415145257-d492cd4be836 h1:YiXBJ/0ZeBzuh9Ym0iYaJgDBlFdz7nIVKArqkkEgPzM=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200415145257-d492cd4be836/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200416113012-dafb32a889ea h1:aiBD966UX0l4rTPgAu+u8CaiMfy+N8qWlZ2TIBp+0eM=
github.com/matrix-org/gomatrixserverlib v0.0.0-20200416113012-dafb32a889ea/go.mod h1:FsKa2pWE/bpQql9H7U4boOPXFoJX/QcqaZZ6ijLkaZI=
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1 h1:osLoFdOy+ChQqVUn2PeTDETFftVkl4w9t/OW18g3lnk=
github.com/matrix-org/naffka v0.0.0-20200127221512-0716baaabaf1/go.mod h1:cXoYQIENbdWIQHt1SyCo6Bl3C3raHwJ0wgVrXHSqf+A=
github.com/matrix-org/util v0.0.0-20171127121716-2e2df66af2f5 h1:W7l5CP4V7wPyPb4tYE11dbmeAOwtFQBTW0rf4OonOS8=
Expand Down
3 changes: 1 addition & 2 deletions roomserver/storage/postgres/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions roomserver/storage/sqlite3/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion roomserver/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3110a81

Please sign in to comment.