Fix DM rooms are not being encrypted (#2286)
* force check user device before creating dm * fix getUserDeviceInfo doesn't exist on MatrixClient
This commit is contained in:
parent
649f70332b
commit
4aed4d7472
1 changed files with 3 additions and 2 deletions
|
@ -102,8 +102,9 @@ export function getIdServer(userId) {
|
|||
|
||||
export async function hasDevices(mx, userId) {
|
||||
try {
|
||||
const usersDeviceMap = await mx.getUserDeviceInfo([userId, mx.getUserId()]);
|
||||
return Object.values(usersDeviceMap)
|
||||
const usersDeviceMap = await mx.getCrypto()?.getUserDeviceInfo([userId, mx.getUserId()], true);
|
||||
|
||||
return Array.from(usersDeviceMap.values())
|
||||
.every((deviceIdToDevices) => deviceIdToDevices.size > 0);
|
||||
} catch (e) {
|
||||
console.error("Error determining if it's possible to encrypt to all users: ", e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue