Removed forwarded properties from the UserSessionProtocol as the ClientProxy is already fully exposed
This commit is contained in:
committed by
Stefan Ceriu
parent
d922d5ef09
commit
58039fb73f
@@ -465,15 +465,15 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
}
|
||||
|
||||
Task {
|
||||
let credentials = SoftLogoutScreenCredentials(userID: userSession.userID,
|
||||
homeserverName: userSession.homeserver,
|
||||
let credentials = SoftLogoutScreenCredentials(userID: userSession.clientProxy.userID,
|
||||
homeserverName: userSession.clientProxy.homeserver,
|
||||
userDisplayName: userSession.clientProxy.userDisplayNamePublisher.value ?? "",
|
||||
deviceID: userSession.deviceID)
|
||||
deviceID: userSession.clientProxy.deviceID)
|
||||
|
||||
let authenticationService = AuthenticationServiceProxy(userSessionStore: userSessionStore,
|
||||
encryptionKeyProvider: EncryptionKeyProvider(),
|
||||
appSettings: appSettings)
|
||||
_ = await authenticationService.configure(for: userSession.homeserver)
|
||||
_ = await authenticationService.configure(for: userSession.clientProxy.homeserver)
|
||||
|
||||
let parameters = SoftLogoutScreenCoordinatorParameters(authenticationService: authenticationService,
|
||||
credentials: credentials,
|
||||
@@ -705,7 +705,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
stopSync()
|
||||
userSessionFlowCoordinator?.stop()
|
||||
|
||||
let userID = userSession.userID
|
||||
let userID = userSession.clientProxy.userID
|
||||
tearDownUserSession()
|
||||
|
||||
// Allow for everything to deallocate properly
|
||||
|
||||
@@ -27,10 +27,6 @@ extension UserSessionMock {
|
||||
self.init()
|
||||
|
||||
clientProxy = configuration.clientProxy
|
||||
userID = clientProxy.userID
|
||||
deviceID = clientProxy.deviceID
|
||||
homeserver = clientProxy.homeserver
|
||||
|
||||
mediaProvider = MockMediaProvider()
|
||||
voiceMessageMediaManager = VoiceMessageMediaManagerMock()
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
|
||||
roomSummaryProvider = userSession.clientProxy.roomSummaryProvider
|
||||
|
||||
super.init(initialViewState: .init(userID: userSession.userID),
|
||||
super.init(initialViewState: .init(userID: userSession.clientProxy.userID),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
|
||||
userSession.clientProxy.userAvatarURLPublisher
|
||||
@@ -236,7 +236,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
|
||||
analyticsService.signpost.beginFirstRooms()
|
||||
|
||||
let hasUserBeenMigrated = appSettings.migratedAccounts[userSession.userID] == true
|
||||
let hasUserBeenMigrated = appSettings.migratedAccounts[userSession.clientProxy.userID] == true
|
||||
|
||||
if !hasUserBeenMigrated {
|
||||
state.roomListMode = .migration
|
||||
@@ -248,7 +248,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
.sink { [weak self] callback in
|
||||
guard let self, case .receivedSyncUpdate = callback else { return }
|
||||
migrationCancellable = nil
|
||||
appSettings.migratedAccounts[userSession.userID] = true
|
||||
appSettings.migratedAccounts[userSession.clientProxy.userID] = true
|
||||
|
||||
MXLog.info("Received first sync response, updating room list mode")
|
||||
|
||||
@@ -279,7 +279,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
}
|
||||
|
||||
private func updateRoomListMode(with roomSummaryProviderState: RoomSummaryProviderState) {
|
||||
guard appSettings.migratedAccounts[userSession.userID] == true else {
|
||||
guard appSettings.migratedAccounts[userSession.clientProxy.userID] == true else {
|
||||
// Ignore room summary provider updates while "migrating"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
|
||||
}
|
||||
|
||||
init(userSession: UserSessionProtocol, appSettings: AppSettings) {
|
||||
super.init(initialViewState: .init(deviceID: userSession.deviceID,
|
||||
userID: userSession.userID,
|
||||
super.init(initialViewState: .init(deviceID: userSession.clientProxy.deviceID,
|
||||
userID: userSession.clientProxy.userID,
|
||||
showDeveloperOptions: appSettings.isDevelopmentBuild),
|
||||
imageProvider: userSession.mediaProvider)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class StartChatScreenViewModel: StartChatScreenViewModelType, StartChatScreenVie
|
||||
self.userIndicatorController = userIndicatorController
|
||||
self.userDiscoveryService = userDiscoveryService
|
||||
|
||||
super.init(initialViewState: StartChatScreenViewState(userID: userSession.userID), imageProvider: userSession.mediaProvider)
|
||||
super.init(initialViewState: StartChatScreenViewState(userID: userSession.clientProxy.userID), imageProvider: userSession.mediaProvider)
|
||||
|
||||
setupBindings()
|
||||
|
||||
|
||||
@@ -23,10 +23,6 @@ class UserSession: UserSessionProtocol {
|
||||
private var cancellables = Set<AnyCancellable>()
|
||||
|
||||
private var authErrorCancellable: AnyCancellable?
|
||||
|
||||
var userID: String { clientProxy.userID }
|
||||
var deviceID: String? { clientProxy.deviceID }
|
||||
var homeserver: String { clientProxy.homeserver }
|
||||
|
||||
let clientProxy: ClientProxyProtocol
|
||||
let mediaProvider: MediaProviderProtocol
|
||||
|
||||
@@ -28,10 +28,6 @@ struct SessionSecurityState: Equatable {
|
||||
|
||||
// sourcery: AutoMockable
|
||||
protocol UserSessionProtocol {
|
||||
var homeserver: String { get }
|
||||
var userID: String { get }
|
||||
var deviceID: String? { get }
|
||||
|
||||
var clientProxy: ClientProxyProtocol { get }
|
||||
var mediaProvider: MediaProviderProtocol { get }
|
||||
var voiceMessageMediaManager: VoiceMessageMediaManagerProtocol { get }
|
||||
|
||||
Reference in New Issue
Block a user