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);