mirror of
https://github.com/RGBCube/cinny
synced 2025-07-30 16:37:46 +00:00
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) {
|
export async function hasDevices(mx, userId) {
|
||||||
try {
|
try {
|
||||||
const usersDeviceMap = await mx.getUserDeviceInfo([userId, mx.getUserId()]);
|
const usersDeviceMap = await mx.getCrypto()?.getUserDeviceInfo([userId, mx.getUserId()], true);
|
||||||
return Object.values(usersDeviceMap)
|
|
||||||
|
return Array.from(usersDeviceMap.values())
|
||||||
.every((deviceIdToDevices) => deviceIdToDevices.size > 0);
|
.every((deviceIdToDevices) => deviceIdToDevices.size > 0);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error determining if it's possible to encrypt to all users: ", 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