Remove usage of deprecated CryptoEvent
s (#126)
* Remove usage of `CryptoEvent.DeviceVerificationChanged` * Remove usage of `CryptoEvent.KeySignatureUploadFailure` * Remove usage of `CryptoEvent.Warning` * Merge `CryptoEvent.DevicesUpdated` and `CryptoEvent.WillUpdateDevices` behaviour
This commit is contained in:
parent
a0cb9470cc
commit
31bd10e887
8 changed files with 1 additions and 196 deletions
|
@ -82,7 +82,6 @@ import Spinner from "../views/elements/Spinner";
|
|||
import QuestionDialog from "../views/dialogs/QuestionDialog";
|
||||
import UserSettingsDialog from "../views/dialogs/UserSettingsDialog";
|
||||
import CreateRoomDialog from "../views/dialogs/CreateRoomDialog";
|
||||
import KeySignatureUploadFailedDialog from "../views/dialogs/KeySignatureUploadFailedDialog";
|
||||
import IncomingSasDialog from "../views/dialogs/IncomingSasDialog";
|
||||
import CompleteSecurity from "./auth/CompleteSecurity";
|
||||
import Welcome from "../views/auth/Welcome";
|
||||
|
@ -1629,18 +1628,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
room.setBlacklistUnverifiedDevices(blacklistEnabled);
|
||||
}
|
||||
});
|
||||
cli.on(CryptoEvent.Warning, (type) => {
|
||||
switch (type) {
|
||||
case "CRYPTO_WARNING_OLD_VERSION_DETECTED":
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: _t("encryption|old_version_detected_title"),
|
||||
description: _t("encryption|old_version_detected_description", {
|
||||
brand: SdkConfig.get().brand,
|
||||
}),
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
cli.on(CryptoEvent.KeyBackupFailed, async (errcode): Promise<void> => {
|
||||
let haveNewVersion: boolean | undefined;
|
||||
let newVersionInfo: KeyBackupInfo | null = null;
|
||||
|
@ -1674,10 +1661,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
}
|
||||
});
|
||||
|
||||
cli.on(CryptoEvent.KeySignatureUploadFailure, (failures, source, continuation) => {
|
||||
Modal.createDialog(KeySignatureUploadFailedDialog, { failures, source, continuation });
|
||||
});
|
||||
|
||||
cli.on(CryptoEvent.VerificationRequestReceived, (request) => {
|
||||
if (request.verifier) {
|
||||
Modal.createDialog(
|
||||
|
|
|
@ -428,7 +428,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
context.client.on(RoomStateEvent.Update, this.onRoomStateUpdate);
|
||||
context.client.on(RoomEvent.MyMembership, this.onMyMembership);
|
||||
context.client.on(CryptoEvent.KeyBackupStatus, this.onKeyBackupStatus);
|
||||
context.client.on(CryptoEvent.DeviceVerificationChanged, this.onDeviceVerificationChanged);
|
||||
context.client.on(CryptoEvent.UserTrustStatusChanged, this.onUserVerificationChanged);
|
||||
context.client.on(CryptoEvent.KeysChanged, this.onCrossSigningKeysChanged);
|
||||
context.client.on(MatrixEventEvent.Decrypted, this.onEventDecrypted);
|
||||
|
@ -974,7 +973,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
this.context.client.removeListener(RoomEvent.MyMembership, this.onMyMembership);
|
||||
this.context.client.removeListener(RoomStateEvent.Update, this.onRoomStateUpdate);
|
||||
this.context.client.removeListener(CryptoEvent.KeyBackupStatus, this.onKeyBackupStatus);
|
||||
this.context.client.removeListener(CryptoEvent.DeviceVerificationChanged, this.onDeviceVerificationChanged);
|
||||
this.context.client.removeListener(CryptoEvent.UserTrustStatusChanged, this.onUserVerificationChanged);
|
||||
this.context.client.removeListener(CryptoEvent.KeysChanged, this.onCrossSigningKeysChanged);
|
||||
this.context.client.removeListener(MatrixEventEvent.Decrypted, this.onEventDecrypted);
|
||||
|
@ -1438,14 +1436,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
);
|
||||
};
|
||||
|
||||
private onDeviceVerificationChanged = (userId: string): void => {
|
||||
const room = this.state.room;
|
||||
if (!room?.currentState.getMember(userId)) {
|
||||
return;
|
||||
}
|
||||
this.updateE2EStatus(room);
|
||||
};
|
||||
|
||||
private onUserVerificationChanged = (userId: string): void => {
|
||||
const room = this.state.room;
|
||||
if (!room || !room.currentState.getMember(userId)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue