Fix ensureDmExists for encryption detection

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-10-01 15:11:01 +01:00
parent 0f2c08f532
commit 245ead48b8
1 changed files with 2 additions and 2 deletions

View File

@ -289,9 +289,9 @@ export async function ensureDMExists(client: MatrixClient, userId: string): Prom
if (existingDMRoom) { if (existingDMRoom) {
roomId = existingDMRoom.roomId; roomId = existingDMRoom.roomId;
} else { } else {
let encryption; let encryption: boolean = undefined;
if (privateShouldBeEncrypted()) { if (privateShouldBeEncrypted()) {
encryption = canEncryptToAllUsers(client, [userId]); encryption = await canEncryptToAllUsers(client, [userId]);
} }
roomId = await createRoom({encryption, dmUserId: userId, spinner: false, andView: false}); roomId = await createRoom({encryption, dmUserId: userId, spinner: false, andView: false});
await _waitForMember(client, roomId, userId); await _waitForMember(client, roomId, userId);