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

dbkr/sss
Florian Duros 2024-08-14 17:30:42 +02:00 committed by GitHub
parent 4751c52d82
commit d9846dc62d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import DateSeparator from "../../views/messages/DateSeparator";
import HistoryTile from "../../views/rooms/HistoryTile"; import HistoryTile from "../../views/rooms/HistoryTile";
import EventListSummary from "../../views/elements/EventListSummary"; import EventListSummary from "../../views/elements/EventListSummary";
import { SeparatorKind } from "../../views/messages/TimelineSeparator"; import { SeparatorKind } from "../../views/messages/TimelineSeparator";
import SettingsStore from "../../../settings/SettingsStore";
const groupedStateEvents = [ const groupedStateEvents = [
EventType.RoomMember, EventType.RoomMember,
@ -97,6 +98,12 @@ export class MainGrouper extends BaseGrouper {
// absorb hidden events to not split the summary // absorb hidden events to not split the summary
return; 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); this.events.push(wrappedEvent);
} }