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