mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Don't show shield next to deleted messages (#7671)
This commit is contained in:
parent
53aca69594
commit
ad87ee0a0f
1 changed files with 12 additions and 5 deletions
|
@ -185,6 +185,10 @@ export function getHandlerTile(ev: MatrixEvent): string {
|
||||||
return stateEventTileTypes[type];
|
return stateEventTileTypes[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ev.isRedacted()) {
|
||||||
|
return "messages.MessageEvent";
|
||||||
|
}
|
||||||
|
|
||||||
return eventTileTypes[type];
|
return eventTileTypes[type];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +766,7 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
};
|
};
|
||||||
|
|
||||||
private async verifyEvent(mxEvent: MatrixEvent): Promise<void> {
|
private async verifyEvent(mxEvent: MatrixEvent): Promise<void> {
|
||||||
if (!mxEvent.isEncrypted()) {
|
if (!mxEvent.isEncrypted() || mxEvent.isRedacted()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1020,8 +1024,8 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
return <E2ePadlockUndecryptable />;
|
return <E2ePadlockUndecryptable />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// event is encrypted, display padlock corresponding to whether or not it is verified
|
// event is encrypted and not redacted, display padlock corresponding to whether or not it is verified
|
||||||
if (ev.isEncrypted()) {
|
if (ev.isEncrypted() && !ev.isRedacted()) {
|
||||||
if (this.state.verified === E2EState.Normal) {
|
if (this.state.verified === E2EState.Normal) {
|
||||||
return; // no icon if we've not even cross-signed the user
|
return; // no icon if we've not even cross-signed the user
|
||||||
} else if (this.state.verified === E2EState.Verified) {
|
} else if (this.state.verified === E2EState.Verified) {
|
||||||
|
@ -1047,6 +1051,9 @@ export default class EventTile extends React.Component<IProps, IState> {
|
||||||
if (ev.isState()) {
|
if (ev.isState()) {
|
||||||
return; // we expect this to be unencrypted
|
return; // we expect this to be unencrypted
|
||||||
}
|
}
|
||||||
|
if (ev.isRedacted()) {
|
||||||
|
return; // we expect this to be unencrypted
|
||||||
|
}
|
||||||
// if the event is not encrypted, but it's an e2e room, show the open padlock
|
// if the event is not encrypted, but it's an e2e room, show the open padlock
|
||||||
return <E2ePadlockUnencrypted />;
|
return <E2ePadlockUnencrypted />;
|
||||||
}
|
}
|
||||||
|
@ -1611,8 +1618,8 @@ function isMessageEvent(ev: MatrixEvent): boolean {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function haveTileForEvent(e: MatrixEvent, showHiddenEvents?: boolean): boolean {
|
export function haveTileForEvent(e: MatrixEvent, showHiddenEvents?: boolean): boolean {
|
||||||
// Only messages have a tile (black-rectangle) if redacted
|
// Only show "Message deleted" tile for message or encrypted events
|
||||||
if (e.isRedacted() && !isMessageEvent(e)) return false;
|
if (e.isRedacted() && !e.isEncrypted() && !isMessageEvent(e)) return false;
|
||||||
|
|
||||||
// No tile for replacement events since they update the original tile
|
// No tile for replacement events since they update the original tile
|
||||||
if (e.isRelation("m.replace")) return false;
|
if (e.isRelation("m.replace")) return false;
|
||||||
|
|
Loading…
Reference in a new issue