Clean up signature of `verifyEvent`

It doesn't need to be `async`, and it doesn't need us to pass in the event
every time.
pull/28788/head^2
Richard van der Hoff 2022-12-17 23:22:31 +00:00
parent e3f591e7d2
commit 46e47a821e
1 changed files with 8 additions and 6 deletions

View File

@ -395,7 +395,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
const room = client.getRoom(this.props.mxEvent.getRoomId());
room?.on(ThreadEvent.New, this.onNewThread);
this.verifyEvent(this.props.mxEvent);
this.verifyEvent();
}
private get supportsThreadNotifications(): boolean {
@ -478,7 +478,7 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
}
// re-check the sender verification as outgoing events progress through the send process.
if (prevProps.eventSendStatus !== this.props.eventSendStatus) {
this.verifyEvent(this.props.mxEvent);
this.verifyEvent();
}
}
@ -588,23 +588,25 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
// we need to re-verify the sending device.
// (we call onHeightChanged in verifyEvent to handle the case where decryption
// has caused a change in size of the event tile)
this.verifyEvent(this.props.mxEvent);
this.verifyEvent();
this.forceUpdate();
};
private onDeviceVerificationChanged = (userId: string, device: string): void => {
if (userId === this.props.mxEvent.getSender()) {
this.verifyEvent(this.props.mxEvent);
this.verifyEvent();
}
};
private onUserVerificationChanged = (userId: string, _trustStatus: UserTrustLevel): void => {
if (userId === this.props.mxEvent.getSender()) {
this.verifyEvent(this.props.mxEvent);
this.verifyEvent();
}
};
private async verifyEvent(mxEvent: MatrixEvent): Promise<void> {
private verifyEvent(): void {
const mxEvent = this.props.mxEvent;
if (!mxEvent.isEncrypted() || mxEvent.isRedacted()) {
return;
}