Don't enable e2ee from profileViewer for bridge users (#666)
This commit is contained in:
parent
7decbb6eef
commit
47e6527b0e
3 changed files with 16 additions and 15 deletions
src/util
|
@ -199,3 +199,16 @@ export function getSSKeyInfo(key) {
|
|||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export async function hasDevices(userId) {
|
||||
const mx = initMatrix.matrixClient;
|
||||
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue