Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/views/rooms/EventTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ export class UnwrappedEventTile extends React.Component<EventTileProps, IState>
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
Expand Down
14 changes: 12 additions & 2 deletions test/unit-tests/components/views/rooms/EventTile-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Loading