Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0a3a111

Browse files
authored
Use new CryptoEvent.VerificationRequestReceived event (#11141)
matrix-org/matrix-js-sdk#3514 deprecates `CryptoEvent.VerificationRequest` in favour of `CryptoEvent.VerificationRequestReceived`. Use the new event.
1 parent 3ac9066 commit 0a3a111

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/components/structures/MatrixChat.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
16591659
Modal.createDialog(KeySignatureUploadFailedDialog, { failures, source, continuation });
16601660
});
16611661

1662-
cli.on(CryptoEvent.VerificationRequest, (request) => {
1662+
cli.on(CryptoEvent.VerificationRequestReceived, (request) => {
16631663
if (request.verifier) {
16641664
Modal.createDialog(
16651665
IncomingSasDialog,

src/components/views/dialogs/devtools/VerificationExplorer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const VerificationExplorer: Tool = ({ onBack }: IDevtoolsProps) => {
8383
const cli = useContext(MatrixClientContext);
8484
const context = useContext(DevtoolsContext);
8585

86-
const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequest, () => {
86+
const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequestReceived, () => {
8787
return (
8888
cli.crypto?.inRoomVerificationRequests["requestsByRoomId"]?.get(context.room.roomId) ??
8989
new Map<string, VerificationRequest>()

src/stores/SetupEncryptionStore.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class SetupEncryptionStore extends EventEmitter {
6464
this.phase = Phase.Loading;
6565

6666
const cli = MatrixClientPeg.safeGet();
67-
cli.on(CryptoEvent.VerificationRequest, this.onVerificationRequest);
67+
cli.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
6868
cli.on(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
6969

7070
const requestsInProgress = cli.getCrypto()!.getVerificationRequestsToDeviceInProgress(cli.getUserId()!);
@@ -87,7 +87,7 @@ export class SetupEncryptionStore extends EventEmitter {
8787

8888
const cli = MatrixClientPeg.get();
8989
if (!!cli) {
90-
cli.removeListener(CryptoEvent.VerificationRequest, this.onVerificationRequest);
90+
cli.removeListener(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
9191
cli.removeListener(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
9292
}
9393
}

src/stores/right-panel/RightPanelStore.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ export default class RightPanelStore extends ReadyWatchingStore {
6666

6767
protected async onReady(): Promise<any> {
6868
this.viewedRoomId = SdkContextClass.instance.roomViewStore.getRoomId();
69-
this.matrixClient?.on(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
69+
this.matrixClient?.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
7070
this.loadCacheFromSettings();
7171
this.emitAndUpdateSettings();
7272
}
7373

7474
protected async onNotReady(): Promise<any> {
75-
this.matrixClient?.off(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
75+
this.matrixClient?.off(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
7676
}
7777

7878
protected onDispatcherAction(payload: ActionPayload): void {

0 commit comments

Comments
 (0)