mirror of https://github.com/vector-im/riot-web
Use new `CryptoEvent.VerificationRequestReceived` event (#11141)
https://github.com/matrix-org/matrix-js-sdk/pull/3514 deprecates `CryptoEvent.VerificationRequest` in favour of `CryptoEvent.VerificationRequestReceived`. Use the new event.pull/28788/head^2
parent
3ac9066e46
commit
0a3a111327
|
@ -1659,7 +1659,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
||||||
Modal.createDialog(KeySignatureUploadFailedDialog, { failures, source, continuation });
|
Modal.createDialog(KeySignatureUploadFailedDialog, { failures, source, continuation });
|
||||||
});
|
});
|
||||||
|
|
||||||
cli.on(CryptoEvent.VerificationRequest, (request) => {
|
cli.on(CryptoEvent.VerificationRequestReceived, (request) => {
|
||||||
if (request.verifier) {
|
if (request.verifier) {
|
||||||
Modal.createDialog(
|
Modal.createDialog(
|
||||||
IncomingSasDialog,
|
IncomingSasDialog,
|
||||||
|
|
|
@ -83,7 +83,7 @@ const VerificationExplorer: Tool = ({ onBack }: IDevtoolsProps) => {
|
||||||
const cli = useContext(MatrixClientContext);
|
const cli = useContext(MatrixClientContext);
|
||||||
const context = useContext(DevtoolsContext);
|
const context = useContext(DevtoolsContext);
|
||||||
|
|
||||||
const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequest, () => {
|
const requests = useTypedEventEmitterState(cli, CryptoEvent.VerificationRequestReceived, () => {
|
||||||
return (
|
return (
|
||||||
cli.crypto?.inRoomVerificationRequests["requestsByRoomId"]?.get(context.room.roomId) ??
|
cli.crypto?.inRoomVerificationRequests["requestsByRoomId"]?.get(context.room.roomId) ??
|
||||||
new Map<string, VerificationRequest>()
|
new Map<string, VerificationRequest>()
|
||||||
|
|
|
@ -64,7 +64,7 @@ export class SetupEncryptionStore extends EventEmitter {
|
||||||
this.phase = Phase.Loading;
|
this.phase = Phase.Loading;
|
||||||
|
|
||||||
const cli = MatrixClientPeg.safeGet();
|
const cli = MatrixClientPeg.safeGet();
|
||||||
cli.on(CryptoEvent.VerificationRequest, this.onVerificationRequest);
|
cli.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
|
||||||
cli.on(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
|
cli.on(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
|
||||||
|
|
||||||
const requestsInProgress = cli.getCrypto()!.getVerificationRequestsToDeviceInProgress(cli.getUserId()!);
|
const requestsInProgress = cli.getCrypto()!.getVerificationRequestsToDeviceInProgress(cli.getUserId()!);
|
||||||
|
@ -87,7 +87,7 @@ export class SetupEncryptionStore extends EventEmitter {
|
||||||
|
|
||||||
const cli = MatrixClientPeg.get();
|
const cli = MatrixClientPeg.get();
|
||||||
if (!!cli) {
|
if (!!cli) {
|
||||||
cli.removeListener(CryptoEvent.VerificationRequest, this.onVerificationRequest);
|
cli.removeListener(CryptoEvent.VerificationRequestReceived, this.onVerificationRequest);
|
||||||
cli.removeListener(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
|
cli.removeListener(CryptoEvent.UserTrustStatusChanged, this.onUserTrustStatusChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,13 +66,13 @@ export default class RightPanelStore extends ReadyWatchingStore {
|
||||||
|
|
||||||
protected async onReady(): Promise<any> {
|
protected async onReady(): Promise<any> {
|
||||||
this.viewedRoomId = SdkContextClass.instance.roomViewStore.getRoomId();
|
this.viewedRoomId = SdkContextClass.instance.roomViewStore.getRoomId();
|
||||||
this.matrixClient?.on(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
|
this.matrixClient?.on(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
|
||||||
this.loadCacheFromSettings();
|
this.loadCacheFromSettings();
|
||||||
this.emitAndUpdateSettings();
|
this.emitAndUpdateSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async onNotReady(): Promise<any> {
|
protected async onNotReady(): Promise<any> {
|
||||||
this.matrixClient?.off(CryptoEvent.VerificationRequest, this.onVerificationRequestUpdate);
|
this.matrixClient?.off(CryptoEvent.VerificationRequestReceived, this.onVerificationRequestUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onDispatcherAction(payload: ActionPayload): void {
|
protected onDispatcherAction(payload: ActionPayload): void {
|
||||||
|
|
Loading…
Reference in New Issue