Use new accessors for VerificationRequest
(#11092)
* Switch verification request accessors to go via CryptoApi part of https://github.com/vector-im/crypto-internal/issues/97 * Update references to `requestVerification` https://github.com/vector-im/crypto-internal/issues/98
This commit is contained in:
parent
dd46db4817
commit
06fa49a9da
5 changed files with 7 additions and 7 deletions
|
@ -89,7 +89,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
|
|||
private onVerifyClick = (): void => {
|
||||
const cli = MatrixClientPeg.safeGet();
|
||||
const userId = cli.getSafeUserId();
|
||||
const requestPromise = cli.requestVerification(userId);
|
||||
const requestPromise = cli.getCrypto()!.requestOwnUserVerification();
|
||||
|
||||
// We need to call onFinished now to close this dialog, and
|
||||
// again later to signal that the verification is complete.
|
||||
|
|
|
@ -177,7 +177,7 @@ export const useOwnDevices = (): DevicesState => {
|
|||
const requestDeviceVerification =
|
||||
isCurrentDeviceVerified && userId
|
||||
? async (deviceId: ExtendedDevice["device_id"]): Promise<VerificationRequest> => {
|
||||
return await matrixClient.requestVerification(userId, [deviceId]);
|
||||
return await matrixClient.getCrypto()!.requestDeviceVerification(userId, deviceId);
|
||||
}
|
||||
: undefined;
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ export class SetupEncryptionStore extends EventEmitter {
|
|||
cli.on(CryptoEvent.VerificationRequest, this.onVerificationRequest);
|
||||
cli.on(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
|
||||
|
||||
const requestsInProgress = cli.getVerificationRequestsToDeviceInProgress(cli.getUserId()!);
|
||||
const requestsInProgress = cli.getCrypto()!.getVerificationRequestsToDeviceInProgress(cli.getUserId()!);
|
||||
if (requestsInProgress.length) {
|
||||
// If there are multiple, we take the most recent. Equally if the user sends another request from
|
||||
// another device after this screen has been shown, we'll switch to the new one, so this
|
||||
|
|
|
@ -120,6 +120,6 @@ export function pendingVerificationRequestForUser(
|
|||
): VerificationRequest | undefined {
|
||||
const dmRoom = findDMForUser(matrixClient, user.userId);
|
||||
if (dmRoom) {
|
||||
return matrixClient.findVerificationRequestDMInProgress(dmRoom.roomId);
|
||||
return matrixClient.getCrypto()!.findVerificationRequestDMInProgress(dmRoom.roomId);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue