mirror of https://github.com/vector-im/riot-web
Revert "Assume room should be unencrypted if homeserver does not implement keys/query"
This reverts commit baa7a86e3e
.
pull/21833/head
parent
baa7a86e3e
commit
93f2a83774
|
@ -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": {...}, ... }
|
||||
|
|
Loading…
Reference in New Issue