mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
add NSE sources to EX project to easily implement mocking and allow the code to be unit tested
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user