Restore createRoom.canEncryptToAllUsers (#10491)

This commit is contained in:
Michael Weimann 2023-04-03 11:28:17 +02:00 committed by GitHub
parent 6ac366ee5a
commit 56423d4d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View file

@ -399,11 +399,9 @@ export async function canEncryptToAllUsers(client: MatrixClient, userIds: string
try {
const usersDeviceMap = await client.downloadKeys(userIds);
// There are no devices at all.
if (usersDeviceMap.size === 0) return false;
for (const devices of usersDeviceMap.values()) {
if (devices.size === 0) {
// This user does not have any encryption-capable devices.
return false;
}
}