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 9241313a5..2ed7b52fd 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go +++ b/src/github.com/matrix-org/dendrite/clientapi/routing/createroom.go @@ -169,7 +169,7 @@ func createRoom(req *http.Request, device *authtypes.Device, var joinRules, historyVisibility string switch r.Preset { - case presetPrivateChat, "": + case presetPrivateChat: joinRules = joinRuleInvite historyVisibility = historyVisibilityShared case presetTrustedPrivateChat: @@ -179,6 +179,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