state events for pinning and unpinning (#3123)

This commit is contained in:
Mauro
2024-08-06 17:30:42 +02:00
committed by GitHub
parent e2712f6b0a
commit a39a8f9bd0
6 changed files with 53 additions and 32 deletions
@@ -839,13 +839,12 @@ class ClientProxy: ClientProxyProtocol {
})
}
private let eventFilters: TimelineEventTypeFilter = {
let stateEventFilters: [StateEventType] = [.roomAliases,
private lazy var eventFilters: TimelineEventTypeFilter = {
var stateEventFilters: [StateEventType] = [.roomAliases,
.roomCanonicalAlias,
.roomGuestAccess,
.roomHistoryVisibility,
.roomJoinRules,
.roomPinnedEvents,
.roomPowerLevels,
.roomServerAcl,
.roomTombstone,
@@ -855,6 +854,11 @@ class ClientProxy: ClientProxyProtocol {
.policyRuleServer,
.policyRuleUser]
// Reminder: once the feature flag is not required anymore, change the lazy var back to a let
if !appSettings.pinningEnabled {
stateEventFilters.append(.roomPinnedEvents)
}
return .exclude(eventTypes: stateEventFilters.map { FilterTimelineEventType.state(eventType: $0) })
}()