add NSE sources to EX project to easily implement mocking and allow the code to be unit tested

This commit is contained in:
Mauro Romito
2025-11-18 14:37:32 +01:00
committed by Mauro
parent b67b4fef2f
commit 8e52ef363b
12 changed files with 457 additions and 29 deletions
+16 -3
View File
@@ -9,10 +9,19 @@
import Foundation
import MatrixRustSDK
final class NSEUserSession {
let sessionDirectories: SessionDirectories
let appSettings: CommonSettingsProtocol
// sourcery: AutoMockable
protocol NSEUserSessionProtocol {
var inviteAvatarsVisibility: InviteAvatars { get async }
var mediaPreviewVisibility: MediaPreviews { get async }
var threadsEnabled: Bool { get }
func notificationItemProxy(roomID: String, eventID: String) async -> NotificationItemProxyProtocol?
func roomForIdentifier(_ roomID: String) -> Room?
}
final class NSEUserSession: NSEUserSessionProtocol {
private let sessionDirectories: SessionDirectories
private let appSettings: CommonSettingsProtocol
private let baseClient: Client
private let notificationClient: NotificationClient
private let userID: String
@@ -42,6 +51,10 @@ final class NSEUserSession {
}
}
}
var threadsEnabled: Bool {
appSettings.threadsEnabled
}
init(credentials: KeychainCredentials,
roomID: String,