mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user