Add a new AccountSettings type and compose it with AppSettings into UserSettings.

The new type doesn't contain any settings yet.
This commit is contained in:
Doug
2026-09-25 13:42:37 +01:00
committed by Stefan Ceriu
parent 44fb05f489
commit 54cc1cba60
4 changed files with 74 additions and 14 deletions
@@ -15,11 +15,11 @@ class UserSession: UserSessionProtocol {
private var authErrorCancellable: AnyCancellable?
let clientProxy: ClientProxyProtocol
let mediaProvider: MediaProviderProtocol
let userSettings: UserSettings
let mediaProvider: MediaProviderProtocol
let voiceMessageMediaManager: VoiceMessageMediaManagerProtocol
let liveLocationManager: LiveLocationManagerProtocol
/// Scans media content, `nil` when no content scanner is configured for the server.
let contentScannerService: ContentScannerServiceProtocol?
@@ -30,8 +30,14 @@ class UserSession: UserSessionProtocol {
sessionSecurityStateSubject.asCurrentValuePublisher()
}
init(clientProxy: ClientProxyProtocol, mediaProvider: MediaProviderProtocol, voiceMessageMediaManager: VoiceMessageMediaManagerProtocol, liveLocationManager: LiveLocationManagerProtocol) {
init(clientProxy: ClientProxyProtocol,
userSettings: UserSettings,
mediaProvider: MediaProviderProtocol,
voiceMessageMediaManager: VoiceMessageMediaManagerProtocol,
liveLocationManager: LiveLocationManagerProtocol) {
self.clientProxy = clientProxy
self.userSettings = userSettings
self.mediaProvider = mediaProvider
self.voiceMessageMediaManager = voiceMessageMediaManager
self.liveLocationManager = liveLocationManager
@@ -21,10 +21,11 @@ struct SessionSecurityState: Equatable {
// sourcery: AutoMockable
protocol UserSessionProtocol: Sendable {
var clientProxy: ClientProxyProtocol { get }
var userSettings: UserSettings { get }
var mediaProvider: MediaProviderProtocol { get }
var voiceMessageMediaManager: VoiceMessageMediaManagerProtocol { get }
var liveLocationManager: LiveLocationManagerProtocol { get }
/// Scans media content, `nil` when no content scanner is configured for the server.
var contentScannerService: ContentScannerServiceProtocol? { get }