Merge pull request #5271 from matrix-org/t3chguy/fix/14851

Fix ensureDmExists for encryption detection
This commit is contained in:
Michael Telatynski 2020-10-01 17:59:27 +01:00 committed by GitHub
commit e52e33f5a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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