You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-23 17:02:25 +03:00
Add API to withdraw verification requirement CryptoAPI.withdrawVerificationRequirement (#4646)
* API to withdraw verification `CryptoAPi.withdrawVerificationRequirement` * review: use set up function instead of beforeEach
This commit is contained in:
@@ -699,6 +699,20 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
|
||||
await userIdentity.pinCurrentMasterKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of {@link CryptoApi#withdrawVerificationRequirement}.
|
||||
*/
|
||||
public async withdrawVerificationRequirement(userId: string): Promise<void> {
|
||||
const userIdentity: RustSdkCryptoJs.OtherUserIdentity | RustSdkCryptoJs.OwnUserIdentity | undefined =
|
||||
await this.getOlmMachineOrThrow().getIdentity(new RustSdkCryptoJs.UserId(userId));
|
||||
|
||||
if (userIdentity === undefined) {
|
||||
throw new Error("Cannot withdraw verification of unknown user");
|
||||
}
|
||||
|
||||
await userIdentity.withdrawVerification();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of {@link CryptoApi#isCrossSigningReady}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user