From 245ead48b8f5bc7e59a78fd0ad96f9c6a7463a5c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Oct 2020 15:11:01 +0100 Subject: [PATCH] Fix ensureDmExists for encryption detection Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/createRoom.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createRoom.ts b/src/createRoom.ts index 09de265ebc..078e54f5d8 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -289,9 +289,9 @@ export async function ensureDMExists(client: MatrixClient, userId: string): Prom if (existingDMRoom) { roomId = existingDMRoom.roomId; } else { - let encryption; + let encryption: boolean = undefined; if (privateShouldBeEncrypted()) { - encryption = canEncryptToAllUsers(client, [userId]); + encryption = await canEncryptToAllUsers(client, [userId]); } roomId = await createRoom({encryption, dmUserId: userId, spinner: false, andView: false}); await _waitForMember(client, roomId, userId);