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:
Doug
2026-09-25 13:51:33 +01:00
committed by Stefan Ceriu
parent 54cc1cba60
commit fccad5fc30
117 changed files with 554 additions and 594 deletions
+6 -6
View File
@@ -17,7 +17,7 @@ nonisolated protocol NSEUserSessionProtocol {
}
final nonisolated class NSEUserSession: NSEUserSessionProtocol {
private let appSettings: CommonSettingsProtocol
private let userSettings: CommonSettingsProtocol
private let baseClient: ClientProtocol
private let notificationClient: NotificationClient
private let userID: String
@@ -49,22 +49,22 @@ final nonisolated class NSEUserSession: NSEUserSessionProtocol {
}
var threadsEnabled: Bool {
appSettings.threadsEnabled
userSettings.threadsEnabled
}
init(credentials: KeychainCredentials,
roomID: String,
clientSessionDelegate: ClientSessionDelegate,
clientFactory: ClientFactoryProtocol = ClientFactory(),
appSettings: CommonSettingsProtocol,
userSettings: CommonSettingsProtocol,
appHooks: AppHooks) async throws {
userID = credentials.userID
self.appSettings = appSettings
self.userSettings = userSettings
baseClient = try await clientFactory.makeNSEClient(credentials: credentials,
roomID: roomID,
clientSessionDelegate: clientSessionDelegate,
appSettings: appSettings,
userSettings: userSettings,
appHooks: appHooks)
do {
@@ -75,7 +75,7 @@ final nonisolated class NSEUserSession: NSEUserSessionProtocol {
delegateHandle = try baseClient.setDelegate(delegate: ClientDelegateWrapper())
// Inject the content scanner so the SDK gates the media it downloads whilst building the notification.
if let contentScannerURL = appSettings.contentScannerURL.publisher.value {
if let contentScannerURL = userSettings.contentScannerURL.publisher.value {
let contentScanner = ContentScanner(scannerUrl: contentScannerURL.absoluteString)
await baseClient.setContentScanner(contentScanner: contentScanner)
}
@@ -177,7 +177,7 @@ actor NotificationServiceExtensionActor {
let userSession = try await NSEUserSession(credentials: credentials,
roomID: roomID,
clientSessionDelegate: keychainController,
appSettings: settings,
userSettings: settings,
appHooks: appHooks)
notificationHandler = NotificationHandler(userSession: userSession,