diff --git a/src/components/views/rooms/EventTile.tsx b/src/components/views/rooms/EventTile.tsx index 44420d9efc..1379560d55 100644 --- a/src/components/views/rooms/EventTile.tsx +++ b/src/components/views/rooms/EventTile.tsx @@ -666,6 +666,8 @@ export class UnwrappedEventTile extends React.Component if (this.context.timelineRenderingType === TimelineRenderingType.Notification) return false; if (this.context.timelineRenderingType === TimelineRenderingType.ThreadsList) return false; + if (this.props.isRedacted) return false; + const cli = MatrixClientPeg.safeGet(); const actions = cli.getPushActionsForEvent(this.props.mxEvent.replacingEvent() || this.props.mxEvent); // get the actions for the previous version of the event too if it is an edit diff --git a/test/unit-tests/components/views/rooms/EventTile-test.tsx b/test/unit-tests/components/views/rooms/EventTile-test.tsx index dee79cc8d1..6a04055b33 100644 --- a/test/unit-tests/components/views/rooms/EventTile-test.tsx +++ b/test/unit-tests/components/views/rooms/EventTile-test.tsx @@ -503,14 +503,24 @@ describe("EventTile", () => { expect(isHighlighted(container)).toBeFalsy(); }); - it(`does not highlight when message's push actions does not have a highlight tweak`, () => { + it("does not highlight when message's push actions does not have a highlight tweak", () => { mocked(client.getPushActionsForEvent).mockReturnValue({ notify: true, tweaks: {} }); const { container } = getComponent(); expect(isHighlighted(container)).toBeFalsy(); }); - it(`highlights when message's push actions have a highlight tweak`, () => { + it("does not highlight when message's push actions have a highlight tweak but message has been redacted", () => { + mocked(client.getPushActionsForEvent).mockReturnValue({ + notify: true, + tweaks: { [TweakName.Highlight]: true }, + }); + const { container } = getComponent({ isRedacted: true }); + + expect(isHighlighted(container)).toBeFalsy(); + }); + + it("highlights when message's push actions have a highlight tweak", () => { mocked(client.getPushActionsForEvent).mockReturnValue({ notify: true, tweaks: { [TweakName.Highlight]: true },