Revert "Assume room should be unencrypted if homeserver does not implement keys/query"

This reverts commit baa7a86e3e.
This commit is contained in:
Half-Shot 2020-05-08 16:36:13 +01:00
parent baa7a86e3e
commit 93f2a83774

View file

@ -212,17 +212,7 @@ export async function _waitForMember(client, roomId, userId, opts = { timeout: 1
* can encrypt to.
*/
export async function canEncryptToAllUsers(client, userIds) {
let usersDeviceMap;
try {
usersDeviceMap = await client.downloadKeys(userIds);
} catch (ex) {
if (ex.httpStatus === 404) {
// The endpoint to fetch keys doesn't exist: force unencrypted.
// See: https://github.com/vector-im/riot-web/issues/13598
return false;
}
throw ex;
}
const usersDeviceMap = await client.downloadKeys(userIds);
// { "@user:host": { "DEVICE": {...}, ... }, ... }
return Object.values(usersDeviceMap).every((userDevices) =>
// { "DEVICE": {...}, ... }