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

Commit

Permalink
Use new CryptoEvent.VerificationRequestReceived event
Browse files Browse the repository at this point in the history
matrix-org/matrix-js-sdk#3514 deprecates
`CryptoEvent.VerificationRequest` in favour of
`CryptoEvent.VerificationRequestReceived`. Use the new event.
  • Loading branch information
richvdh committed Jun 26, 2023
1 parent 34d7b7d commit a740f64
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
Modal.createDialog(KeySignatureUploadFailedDialog, { failures, source, continuation });
});

cli.on(CryptoEvent.VerificationRequest, (request) => {
cli.on(CryptoEvent.VerificationRequestReceived, (request) => {
if (request.verifier) {
Modal.createDialog(
IncomingSasDialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const VerificationExplorer: Tool = ({ onBack }: IDevtoolsProps) => {
const cli = useContext(MatrixClientContext);
const context = useContext(DevtoolsContext);

const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequest, () => {
const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequestReceived, () => {
return (
cli.crypto?.inRoomVerificationRequests["requestsByRoomId"]?.get(context.room.roomId) ??
new Map<string, VerificationRequest>()
Expand Down
4 changes: 2 additions & 2 deletions src/stores/SetupEncryptionStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class SetupEncryptionStore extends EventEmitter {
this.phase = Phase.Loading;

const cli = MatrixClientPeg.safeGet();
cli.on(CryptoEvent.VerificationRequest, this.onVerificationRequest);
cli.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
cli.on(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);

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

const cli = MatrixClientPeg.get();
if (!!cli) {
cli.removeListener(CryptoEvent.VerificationRequest, this.onVerificationRequest);
cli.removeListener(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
cli.removeListener(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/stores/right-panel/RightPanelStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ export default class RightPanelStore extends ReadyWatchingStore {

protected async onReady(): Promise<any> {
this.viewedRoomId = SdkContextClass.instance.roomViewStore.getRoomId();
this.matrixClient?.on(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
this.matrixClient?.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
this.loadCacheFromSettings();
this.emitAndUpdateSettings();
}

protected async onNotReady(): Promise<any> {
this.matrixClient?.off(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
this.matrixClient?.off(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
}

protected onDispatcherAction(payload: ActionPayload): void {
Expand Down

0 comments on commit a740f64

Please sign in to comment.