Replace uses of checkDeviceTrust
with getDeviceVerificationStatus
(#10663)
matrix-org/matrix-js-sdk#3287 and matrix-org/matrix-js-sdk#3303 added a new API called getDeviceVerificationStatus. Let's use it.
This commit is contained in:
parent
aa8c0f5cc7
commit
d7bb8043ea
22 changed files with 286 additions and 161 deletions
|
@ -310,7 +310,11 @@ export default class DeviceListener {
|
|||
const newUnverifiedDeviceIds = new Set<string>();
|
||||
|
||||
const isCurrentDeviceTrusted =
|
||||
crossSigningReady && (await cli.checkDeviceTrust(cli.getUserId()!, cli.deviceId!).isCrossSigningVerified());
|
||||
crossSigningReady &&
|
||||
Boolean(
|
||||
(await cli.getCrypto()?.getDeviceVerificationStatus(cli.getUserId()!, cli.deviceId!))
|
||||
?.crossSigningVerified,
|
||||
);
|
||||
|
||||
// as long as cross-signing isn't ready,
|
||||
// you can't see or dismiss any device toasts
|
||||
|
@ -319,8 +323,10 @@ export default class DeviceListener {
|
|||
for (const device of devices) {
|
||||
if (device.deviceId === cli.deviceId) continue;
|
||||
|
||||
const deviceTrust = await cli.checkDeviceTrust(cli.getUserId()!, device.deviceId!);
|
||||
if (!deviceTrust.isCrossSigningVerified() && !this.dismissed.has(device.deviceId)) {
|
||||
const deviceTrust = await cli
|
||||
.getCrypto()!
|
||||
.getDeviceVerificationStatus(cli.getUserId()!, device.deviceId!);
|
||||
if (!deviceTrust?.crossSigningVerified && !this.dismissed.has(device.deviceId)) {
|
||||
if (this.ourDeviceIdsAtStart?.has(device.deviceId)) {
|
||||
oldUnverifiedDeviceIds.add(device.deviceId);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue