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

Use new CryptoEvent.VerificationRequestReceived event #11141

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,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