mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-07 23:13:11 -06:00
remove confusing DefaultForDefaultRoomVersion
This commit is contained in:
parent
5eb20daf15
commit
e54bd5536e
|
|
@ -923,13 +923,17 @@ func TestCapabilities(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var tempRoomServerCfg config.RoomServer
|
||||||
|
tempRoomServerCfg.Defaults(config.DefaultOpts{})
|
||||||
|
defaultRoomVersion := tempRoomServerCfg.DefaultRoomVersion
|
||||||
|
|
||||||
expectedMap := map[string]interface{}{
|
expectedMap := map[string]interface{}{
|
||||||
"capabilities": map[string]interface{}{
|
"capabilities": map[string]interface{}{
|
||||||
"m.change_password": map[string]bool{
|
"m.change_password": map[string]bool{
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
},
|
},
|
||||||
"m.room_versions": map[string]interface{}{
|
"m.room_versions": map[string]interface{}{
|
||||||
"default": config.DefaultForDefaultRoomVersion(),
|
"default": defaultRoomVersion,
|
||||||
"available": versionsMap,
|
"available": versionsMap,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ type RoomServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *RoomServer) Defaults(opts DefaultOpts) {
|
func (c *RoomServer) Defaults(opts DefaultOpts) {
|
||||||
c.DefaultRoomVersion = DefaultForDefaultRoomVersion()
|
c.DefaultRoomVersion = gomatrixserverlib.RoomVersionV10
|
||||||
if opts.Generate {
|
if opts.Generate {
|
||||||
if !opts.SingleDatabase {
|
if !opts.SingleDatabase {
|
||||||
c.Database.ConnectionString = "file:roomserver.db"
|
c.Database.ConnectionString = "file:roomserver.db"
|
||||||
|
|
@ -35,11 +35,3 @@ func (c *RoomServer) Verify(configErrs *ConfigErrors) {
|
||||||
log.Warnf("WARNING: Provided default room version %q is unstable", c.DefaultRoomVersion)
|
log.Warnf("WARNING: Provided default room version %q is unstable", c.DefaultRoomVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the value that is the default for the room_server.default_room_version config key
|
|
||||||
//
|
|
||||||
// Do not use this if you want the default room version, use roomserverAPI.DefaultRoomVersion instead.
|
|
||||||
// This function exists for easier test writing.
|
|
||||||
func DefaultForDefaultRoomVersion() gomatrixserverlib.RoomVersion {
|
|
||||||
return gomatrixserverlib.RoomVersionV10
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue