Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Hide pinned messages when grouped in timeline when feature pinning is…
Browse files Browse the repository at this point in the history
… disabled (#12888)
  • Loading branch information
florianduros authored Aug 14, 2024
1 parent 4751c52 commit d9846dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/structures/grouper/MainGrouper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import DateSeparator from "../../views/messages/DateSeparator";
import HistoryTile from "../../views/rooms/HistoryTile";
import EventListSummary from "../../views/elements/EventListSummary";
import { SeparatorKind } from "../../views/messages/TimelineSeparator";
import SettingsStore from "../../../settings/SettingsStore";

const groupedStateEvents = [
EventType.RoomMember,
Expand Down Expand Up @@ -97,6 +98,12 @@ export class MainGrouper extends BaseGrouper {
// absorb hidden events to not split the summary
return;
}

if (ev.getType() === EventType.RoomPinnedEvents && !SettingsStore.getValue("feature_pinning")) {
// If pinned messages are disabled, don't show the summary
return;
}

this.events.push(wrappedEvent);
}

Expand Down

0 comments on commit d9846dc

Please sign in to comment.