Track decryption failures for visible events only, with a shorter grace period (#7579)

This commit is contained in:
Faye Duxovni 2022-01-19 14:31:43 -05:00 committed by GitHub
parent ec6bb88068
commit 582a1b093f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 229 additions and 87 deletions

View file

@ -74,6 +74,7 @@ import { NotificationColor } from '../../../stores/notifications/NotificationCol
import AccessibleButton, { ButtonEvent } from '../elements/AccessibleButton';
import { CardContext } from '../right_panel/BaseCard';
import { copyPlaintext } from '../../../utils/strings';
import { DecryptionFailureTracker } from '../../../DecryptionFailureTracker';
const eventTileTypes = {
[EventType.RoomMessage]: 'messages.MessageEvent',
@ -501,6 +502,7 @@ export default class EventTile extends React.Component<IProps, IState> {
client.on("deviceVerificationChanged", this.onDeviceVerificationChanged);
client.on("userTrustStatusChanged", this.onUserVerificationChanged);
this.props.mxEvent.on("Event.decrypted", this.onDecrypted);
DecryptionFailureTracker.instance.addVisibleEvent(this.props.mxEvent);
if (this.props.showReactions) {
this.props.mxEvent.on("Event.relationsCreated", this.onReactionsCreated);
}