Don't enable e2ee for bridged platform (#476)
* Don't enable e2ee for bridged platform * remove comments * Change function name Co-authored-by: Ajay Bura <32841439+ajbura@users.noreply.github.com>
This commit is contained in:
parent
b7c322d473
commit
65a0edc3a6
1 changed files with 13 additions and 1 deletions
|
@ -103,6 +103,18 @@ function InviteUser({
|
||||||
updateIsSearching(false);
|
updateIsSearching(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function hasDevices(userId) {
|
||||||
|
try {
|
||||||
|
const usersDeviceMap = await mx.downloadKeys([userId, mx.getUserId()]);
|
||||||
|
return Object.values(usersDeviceMap).every((userDevices) =>
|
||||||
|
Object.keys(userDevices).length > 0,
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error determining if it's possible to encrypt to all users: ", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function createDM(userId) {
|
async function createDM(userId) {
|
||||||
if (mx.getUserId() === userId) return;
|
if (mx.getUserId() === userId) return;
|
||||||
const dmRoomId = hasDMWith(userId);
|
const dmRoomId = hasDMWith(userId);
|
||||||
|
@ -117,7 +129,7 @@ function InviteUser({
|
||||||
procUserError.delete(userId);
|
procUserError.delete(userId);
|
||||||
updateUserProcError(getMapCopy(procUserError));
|
updateUserProcError(getMapCopy(procUserError));
|
||||||
|
|
||||||
const result = await roomActions.createDM(userId);
|
const result = await roomActions.createDM(userId, await hasDevices(userId));
|
||||||
roomIdToUserId.set(result.room_id, userId);
|
roomIdToUserId.set(result.room_id, userId);
|
||||||
updateRoomIdToUserId(getMapCopy(roomIdToUserId));
|
updateRoomIdToUserId(getMapCopy(roomIdToUserId));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue