diff --git a/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go b/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go index e5e52016..7b32ca50 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go @@ -88,8 +88,7 @@ func (r createRoomRequest) Validate() *util.JSONResponse { } } switch r.Preset { - case presetPrivateChat, presetTrustedPrivateChat, presetPublicChat: - break + case presetPrivateChat, presetTrustedPrivateChat, presetPublicChat, "": default: return &util.JSONResponse{ Code: http.StatusBadRequest, @@ -181,6 +180,11 @@ func createRoom(req *http.Request, device *authtypes.Device, case presetPublicChat: joinRules = joinRulePublic historyVisibility = historyVisibilityShared + default: + // Default room rules, r.Preset was previously checked for valid values so + // only a request with no preset should end up here. + joinRules = joinRuleInvite + historyVisibility = historyVisibilityShared } var builtEvents []gomatrixserverlib.Event