mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Replace AppSettings with UserSettings from the UserSessionFlow and below.
Remove some redundant injections when passed alongside a user session too. # Conflicts: # ElementX/Sources/Screens/PinnedEventsTimelineScreen/View/PinnedEventsTimelineScreen.swift # ElementX/Sources/Screens/Timeline/TimelineViewModel.swift
This commit is contained in:
@@ -14,7 +14,7 @@ import UIKit
|
||||
class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
private let roomListService: RoomListServiceProtocol
|
||||
private let room: RoomProtocol
|
||||
private let appSettings: AppSettings
|
||||
private let userSettings: UserSettings
|
||||
private let analyticsService: AnalyticsServiceProtocol
|
||||
private let eventStringBuilder: RoomEventStringBuilder
|
||||
|
||||
@@ -71,19 +71,19 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
|
||||
init(roomListService: RoomListServiceProtocol,
|
||||
room: RoomProtocol,
|
||||
appSettings: AppSettings,
|
||||
userSettings: UserSettings,
|
||||
analyticsService: AnalyticsServiceProtocol,
|
||||
eventStringBuilder: RoomEventStringBuilder) async throws {
|
||||
self.roomListService = roomListService
|
||||
self.room = room
|
||||
self.appSettings = appSettings
|
||||
self.userSettings = userSettings
|
||||
self.analyticsService = analyticsService
|
||||
self.eventStringBuilder = eventStringBuilder
|
||||
|
||||
infoSubject = try await .init(RoomInfoProxy(roomInfo: room.roomInfo()))
|
||||
|
||||
let openRoomSpan = analyticsService.signpost.addSpan(.timelineLoad, toTransaction: .openRoom)
|
||||
timeline = try await TimelineProxy(timeline: room.timelineWithConfiguration(configuration: .init(focus: .live(hideThreadedEvents: appSettings.threadsEnabled),
|
||||
timeline = try await TimelineProxy(timeline: room.timelineWithConfiguration(configuration: .init(focus: .live(hideThreadedEvents: userSettings.threadsEnabled),
|
||||
filter: .eventFilter(filter: Self.excludedEventsFilter),
|
||||
internalIdPrefix: nil,
|
||||
dateDividerMode: .daily,
|
||||
@@ -150,7 +150,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
|
||||
let openRoomSpan = analyticsService.signpost.addSpan(.timelineLoad, toTransaction: .notificationToMessage)
|
||||
let sdkTimeline = try await room.timelineWithConfiguration(configuration: .init(focus: .event(eventId: eventID,
|
||||
numContextEvents: numberOfEvents,
|
||||
threadMode: .automatic(hideThreadedEvents: appSettings.threadsEnabled)),
|
||||
threadMode: .automatic(hideThreadedEvents: userSettings.threadsEnabled)),
|
||||
filter: .all,
|
||||
internalIdPrefix: UUID().uuidString,
|
||||
dateDividerMode: .daily,
|
||||
|
||||
@@ -16,7 +16,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
private let name: String
|
||||
private let shouldUpdateVisibleRange: Bool
|
||||
private let notificationSettings: NotificationSettingsProxyProtocol
|
||||
private let appSettings: AppSettings
|
||||
private let userSettings: UserSettings
|
||||
|
||||
private let roomListPageSize: UInt32
|
||||
/// Remember how many rooms we had on the previous requests so we can deduplicate
|
||||
@@ -68,13 +68,13 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
shouldUpdateVisibleRange: Bool = false,
|
||||
roomListPageSize: UInt32 = 100,
|
||||
notificationSettings: NotificationSettingsProxyProtocol,
|
||||
appSettings: AppSettings) {
|
||||
userSettings: UserSettings) {
|
||||
self.roomListService = roomListService
|
||||
self.eventStringBuilder = eventStringBuilder
|
||||
self.name = name
|
||||
self.shouldUpdateVisibleRange = shouldUpdateVisibleRange
|
||||
self.notificationSettings = notificationSettings
|
||||
self.appSettings = appSettings
|
||||
self.userSettings = userSettings
|
||||
self.roomListPageSize = roomListPageSize
|
||||
|
||||
let (diffsStream, diffsContinuation) = AsyncStream<[RoomListEntriesUpdate]>.makeStream()
|
||||
@@ -161,7 +161,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
|
||||
rustFilters.append(.identifiers(identifiers: Array(roomIDs)))
|
||||
|
||||
if !filters.contains(.lowPriority), appSettings.lowPriorityFilterEnabled {
|
||||
if !filters.contains(.lowPriority), userSettings.lowPriorityFilterEnabled {
|
||||
rustFilters.append(.nonLowPriority)
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
case let .all(filters):
|
||||
var rustFilters = filters.map(\.rustFilter) + baseFilter
|
||||
|
||||
if !filters.contains(.lowPriority), appSettings.lowPriorityFilterEnabled {
|
||||
if !filters.contains(.lowPriority), userSettings.lowPriorityFilterEnabled {
|
||||
rustFilters.append(.nonLowPriority)
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
// MARK: - Private
|
||||
|
||||
private func nameFilter(for query: String) -> [RoomListEntriesDynamicFilterKind] {
|
||||
appSettings.fuzzyRoomListSearchEnabled ? [.fuzzyMatchRoomName(pattern: query)] : [.normalizedMatchRoomName(pattern: query)]
|
||||
userSettings.fuzzyRoomListSearchEnabled ? [.fuzzyMatchRoomName(pattern: query)] : [.normalizedMatchRoomName(pattern: query)]
|
||||
}
|
||||
|
||||
private func setupVisibleRangeObservers() {
|
||||
|
||||
Reference in New Issue
Block a user