From 0e070ead41effa210bad3c85298c326efb8a63ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sun, 12 Jun 2022 19:23:34 +0200 Subject: [PATCH] Fix incorrect visibility being assumed when creating a room MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/createRoom.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/createRoom.ts b/src/createRoom.ts index 66177d812b1..09f00bdac87 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -102,7 +102,7 @@ export default async function createRoom(opts: IOpts): Promise { // set some defaults for the creation const createOpts: ICreateRoomOpts = opts.createOpts || {}; createOpts.preset = createOpts.preset || defaultPreset; - createOpts.visibility = createOpts.visibility || Visibility.Private; + createOpts.visibility = createOpts.preset === Preset.PublicChat ? Visibility.Public : Visibility.Private; if (opts.dmUserId && createOpts.invite === undefined) { switch (getAddressType(opts.dmUserId)) { case 'mx-user-id':