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

Hide pinned messages when grouped in timeline when feature pinning is disabled #12888

Merged
merged 1 commit into from
Aug 14, 2024
Merged
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
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
Loading