Remove MatrixClient.getDehydratedDevice call (#28254)

This commit is contained in:
Florian Duros
2024-10-22 10:09:07 +02:00
committed by GitHub
parent 3c8ac6fc49
commit 4a1f86f273
2 changed files with 3 additions and 30 deletions

View File

@@ -101,18 +101,14 @@ export class SetupEncryptionStore extends EventEmitter {
this.keyInfo = keys[this.keyId];
}
// do we have any other verified devices which are E2EE which we can verify against?
const dehydratedDevice = await cli.getDehydratedDevice();
const ownUserId = cli.getUserId()!;
const crypto = cli.getCrypto()!;
// do we have any other verified devices which are E2EE which we can verify against?
const userDevices: Iterable<Device> =
(await crypto.getUserDeviceInfo([ownUserId])).get(ownUserId)?.values() ?? [];
this.hasDevicesToVerifyAgainst = await asyncSome(userDevices, async (device) => {
// Ignore dehydrated devices. `dehydratedDevice` is set by the
// implementation of MSC2697, whereas MSC3814 proposes that devices
// should set a `dehydrated` flag in the device key. We ignore
// both types of dehydrated devices.
if (dehydratedDevice && device.deviceId == dehydratedDevice?.device_id) return false;
// Ignore dehydrated devices. MSC3814 proposes that devices
// should set a `dehydrated` flag in the device key.
if (device.dehydrated) return false;
// ignore devices without an identity key