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.
|
* can encrypt to.
|
||||||
*/
|
*/
|
||||||
export async function canEncryptToAllUsers(client, userIds) {
|
export async function canEncryptToAllUsers(client, userIds) {
|
||||||
let usersDeviceMap;
|
const usersDeviceMap = await client.downloadKeys(userIds);
|
||||||
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;
|
|
||||||
}
|
|
||||||
// { "@user:host": { "DEVICE": {...}, ... }, ... }
|
// { "@user:host": { "DEVICE": {...}, ... }, ... }
|
||||||
return Object.values(usersDeviceMap).every((userDevices) =>
|
return Object.values(usersDeviceMap).every((userDevices) =>
|
||||||
// { "DEVICE": {...}, ... }
|
// { "DEVICE": {...}, ... }
|
||||||
|
|
Loading…
Reference in New Issue