mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add a new UserHooks container and move some AppHooks. (#6332)
* Add a UserHooks system with just the CreateRoomScreenHook for now. * Move more hooks into UserHooks. * Pass the ClientProxy to makeUserHooks instead of calling AppHooks.configure(with:). * Update the Enterprise submodule.
This commit is contained in:
@@ -12,10 +12,6 @@ import Synchronization
|
||||
|
||||
final nonisolated class AppHooks: AppHooksProtocol {
|
||||
#if IS_MAIN_APP
|
||||
func configure(with userSession: UserSessionProtocol?) async {
|
||||
await userSessionHook.configure(with: userSession)
|
||||
}
|
||||
|
||||
@AppHook(default: DefaultAppSettingsHook())
|
||||
var appSettingsHook: AppSettingsHookProtocol
|
||||
|
||||
@@ -28,29 +24,8 @@ final nonisolated class AppHooks: AppHooksProtocol {
|
||||
@AppHook(default: DefaultOAuthPresenterHook())
|
||||
var oAuthPresenterHook: OAuthPresenterHookProtocol
|
||||
|
||||
@AppHook(default: DefaultRoomScreenHook())
|
||||
var roomScreenHook: RoomScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultRoomDetailsScreenHook())
|
||||
var roomDetailsScreenHook: RoomDetailsScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultRoomMemberDetailsScreenHook())
|
||||
var roomMemberDetailsScreenHook: RoomMemberDetailsScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultUserProfileScreenHook())
|
||||
var userProfileScreenHook: UserProfileScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultDeveloperOptionsScreenHook())
|
||||
var developerOptionsScreenHook: DeveloperOptionsScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultRecoveryKeyScreenHook())
|
||||
var recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultCreateRoomScreenHook())
|
||||
var createRoomScreenHook: CreateRoomScreenHookProtocol
|
||||
|
||||
@AppHook(default: DefaultSecurityAndPrivacyScreenHook())
|
||||
var securityAndPrivacyScreenHook: SecurityAndPrivacyScreenHookProtocol
|
||||
#endif
|
||||
|
||||
@AppHook(default: DefaultTracingHook())
|
||||
|
||||
@@ -9,7 +9,7 @@ import MatrixRustSDK
|
||||
|
||||
nonisolated protocol UserSessionHookProtocol: Sendable {
|
||||
#if IS_MAIN_APP
|
||||
func configure(with userSession: UserSessionProtocol?) async
|
||||
@MainActor func makeUserHooks(for clientProxy: ClientProxyProtocol) -> UserHooks
|
||||
#endif
|
||||
|
||||
func configure(_ userSettings: UserSettings, forHomeserver homeserver: String) -> UserSettings
|
||||
@@ -17,7 +17,9 @@ nonisolated protocol UserSessionHookProtocol: Sendable {
|
||||
|
||||
nonisolated struct DefaultUserSessionHook: UserSessionHookProtocol {
|
||||
#if IS_MAIN_APP
|
||||
func configure(with userSession: UserSessionProtocol?) async { }
|
||||
func makeUserHooks(for clientProxy: ClientProxyProtocol) -> UserHooks {
|
||||
UserHooks()
|
||||
}
|
||||
#endif
|
||||
|
||||
func configure(_ userSettings: UserSettings, forHomeserver homeserver: String) -> UserSettings {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
nonisolated struct UserHooks: Sendable {
|
||||
let roomScreenHook: RoomScreenHookProtocol
|
||||
let roomDetailsScreenHook: RoomDetailsScreenHookProtocol
|
||||
let roomMemberDetailsScreenHook: RoomMemberDetailsScreenHookProtocol
|
||||
let userProfileScreenHook: UserProfileScreenHookProtocol
|
||||
let recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol
|
||||
let createRoomScreenHook: CreateRoomScreenHookProtocol
|
||||
let securityAndPrivacyScreenHook: SecurityAndPrivacyScreenHookProtocol
|
||||
|
||||
init(roomScreenHook: RoomScreenHookProtocol = DefaultRoomScreenHook(),
|
||||
roomDetailsScreenHook: RoomDetailsScreenHookProtocol = DefaultRoomDetailsScreenHook(),
|
||||
roomMemberDetailsScreenHook: RoomMemberDetailsScreenHookProtocol = DefaultRoomMemberDetailsScreenHook(),
|
||||
userProfileScreenHook: UserProfileScreenHookProtocol = DefaultUserProfileScreenHook(),
|
||||
recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol = DefaultRecoveryKeyScreenHook(),
|
||||
createRoomScreenHook: CreateRoomScreenHookProtocol = DefaultCreateRoomScreenHook(),
|
||||
securityAndPrivacyScreenHook: SecurityAndPrivacyScreenHookProtocol = DefaultSecurityAndPrivacyScreenHook()) {
|
||||
self.roomScreenHook = roomScreenHook
|
||||
self.roomDetailsScreenHook = roomDetailsScreenHook
|
||||
self.roomMemberDetailsScreenHook = roomMemberDetailsScreenHook
|
||||
self.userProfileScreenHook = userProfileScreenHook
|
||||
self.recoveryKeyScreenHook = recoveryKeyScreenHook
|
||||
self.createRoomScreenHook = createRoomScreenHook
|
||||
self.securityAndPrivacyScreenHook = securityAndPrivacyScreenHook
|
||||
}
|
||||
}
|
||||
@@ -980,7 +980,6 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationFlowCoordinatorDeleg
|
||||
configureNotificationManager(for: userSession)
|
||||
Task {
|
||||
await resumeClientServices()
|
||||
await appHooks.configure(with: userSession)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -659,8 +659,8 @@ class ChatsTabFlowCoordinator: FlowCoordinatorProtocol {
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
isModallyPresented: true)
|
||||
|
||||
let coordinator = flowParameters.appHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
let coordinator = userSession.userHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
coordinator.actions.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
@@ -744,7 +744,6 @@ class ChatsTabFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let parameters = UserProfileScreenCoordinatorParameters(userID: userID,
|
||||
isPresentedModally: true,
|
||||
userSession: userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analytics: flowParameters.analytics,
|
||||
userIndicatorController: flowParameters.userIndicatorController)
|
||||
let coordinator = UserProfileScreenCoordinator(parameters: parameters)
|
||||
|
||||
@@ -17,7 +17,6 @@ enum EncryptionSettingsFlowCoordinatorAction: Equatable {
|
||||
|
||||
struct EncryptionSettingsFlowCoordinatorParameters {
|
||||
let userSession: UserSessionProtocol
|
||||
let appHooks: AppHooks
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
let navigationStackCoordinator: NavigationStackCoordinator
|
||||
}
|
||||
@@ -25,7 +24,6 @@ struct EncryptionSettingsFlowCoordinatorParameters {
|
||||
class EncryptionSettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
private let userSession: UserSessionProtocol
|
||||
private let userSettings: UserSettings
|
||||
private let appHooks: AppHooks
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
private let navigationStackCoordinator: NavigationStackCoordinator
|
||||
|
||||
@@ -66,7 +64,6 @@ class EncryptionSettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
init(parameters: EncryptionSettingsFlowCoordinatorParameters) {
|
||||
userSession = parameters.userSession
|
||||
userSettings = parameters.userSession.userSettings
|
||||
appHooks = parameters.appHooks
|
||||
userIndicatorController = parameters.userIndicatorController
|
||||
navigationStackCoordinator = parameters.navigationStackCoordinator
|
||||
|
||||
@@ -163,8 +160,8 @@ class EncryptionSettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let parameters = SecureBackupRecoveryKeyScreenCoordinatorParameters(secureBackupController: userSession.clientProxy.secureBackupController,
|
||||
userIndicatorController: userIndicatorController,
|
||||
isModallyPresented: true)
|
||||
let coordinator = appHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
let coordinator = userSession.userHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
|
||||
coordinator.actions.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
@@ -302,8 +302,8 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
userIndicatorController: userIndicatorController,
|
||||
isModallyPresented: false)
|
||||
|
||||
let coordinator = appHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
let coordinator = userSession.userHooks.recoveryKeyScreenHook.makeCoordinator(parameters: parameters,
|
||||
homeserver: userSession.clientProxy.homeserver)
|
||||
|
||||
coordinator.actions
|
||||
.sink { action in
|
||||
|
||||
@@ -681,7 +681,6 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
completionSuggestionService: completionSuggestionService,
|
||||
ongoingCallRoomIDPublisher: flowParameters.ongoingCallRoomIDPublisher,
|
||||
appMediator: flowParameters.appMediator,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analytics: flowParameters.analytics,
|
||||
composerDraftService: composerDraftService,
|
||||
timelineControllerFactory: flowParameters.timelineControllerFactory,
|
||||
@@ -937,7 +936,6 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
private func presentRoomDetails(isRoot: Bool, animated: Bool) async {
|
||||
let params = RoomDetailsScreenCoordinatorParameters(roomProxy: roomProxy,
|
||||
userSession: userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analyticsService: flowParameters.analytics,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
notificationSettings: userSession.clientProxy.notificationSettings,
|
||||
@@ -1413,8 +1411,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
|
||||
private func presentSecurityAndPrivacyScreen() {
|
||||
let coordinator = SecurityAndPrivacyScreenCoordinator(parameters: .init(roomProxy: roomProxy,
|
||||
userSession: userSession,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
appHooks: flowParameters.appHooks))
|
||||
userIndicatorController: flowParameters.userIndicatorController))
|
||||
|
||||
coordinator.actionsPublisher.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
@@ -231,7 +231,6 @@ final class RoomMembersFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let params = RoomMemberDetailsScreenCoordinatorParameters(userID: userID,
|
||||
roomProxy: roomProxy,
|
||||
userSession: flowParameters.userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analytics: flowParameters.analytics,
|
||||
userIndicatorController: flowParameters.userIndicatorController)
|
||||
let coordinator = RoomMemberDetailsScreenCoordinator(parameters: params)
|
||||
@@ -288,7 +287,6 @@ final class RoomMembersFlowCoordinator: FlowCoordinatorProtocol {
|
||||
let parameters = UserProfileScreenCoordinatorParameters(userID: userID,
|
||||
isPresentedModally: false,
|
||||
userSession: flowParameters.userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analytics: flowParameters.analytics,
|
||||
userIndicatorController: flowParameters.userIndicatorController)
|
||||
let coordinator = UserProfileScreenCoordinator(parameters: parameters)
|
||||
|
||||
@@ -157,7 +157,6 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
private func startEncryptionSettingsFlow() {
|
||||
let coordinator = EncryptionSettingsFlowCoordinator(parameters: .init(userSession: flowParameters.userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
navigationStackCoordinator: navigationStackCoordinator))
|
||||
coordinator.actionsPublisher.sink { [weak self] action in
|
||||
|
||||
@@ -211,7 +211,6 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
private func presentSpaceSettings(animated: Bool) {
|
||||
let coordinator = RoomDetailsScreenCoordinator(parameters: .init(roomProxy: roomProxy,
|
||||
userSession: flowParameters.userSession,
|
||||
appHooks: flowParameters.appHooks,
|
||||
analyticsService: flowParameters.analytics,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
notificationSettings: flowParameters.userSession.clientProxy.notificationSettings,
|
||||
@@ -276,8 +275,7 @@ final class SpaceSettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
private func presentSecurityAndPrivacyScreen() {
|
||||
let coordinator = SecurityAndPrivacyScreenCoordinator(parameters: .init(roomProxy: roomProxy,
|
||||
userSession: flowParameters.userSession,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
appHooks: flowParameters.appHooks))
|
||||
userIndicatorController: flowParameters.userIndicatorController))
|
||||
|
||||
coordinator.actionsPublisher.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
@@ -214,8 +214,7 @@ class StartChatFlowCoordinator: FlowCoordinatorProtocol {
|
||||
shouldShowCancelButton: isRoot,
|
||||
userSession: flowParameters.userSession,
|
||||
userIndicatorController: flowParameters.userIndicatorController,
|
||||
analytics: flowParameters.analytics,
|
||||
appHooks: flowParameters.appHooks)
|
||||
analytics: flowParameters.analytics)
|
||||
let coordinator = CreateRoomScreenCoordinator(parameters: createParameters)
|
||||
coordinator.actions.sink { [weak self] action in
|
||||
guard let self else { return }
|
||||
|
||||
@@ -15175,6 +15175,11 @@ nonisolated class UserSessionMock: UserSessionProtocol, @unchecked Sendable {
|
||||
set(value) { underlyingUserSettings = value }
|
||||
}
|
||||
nonisolated(unsafe) var underlyingUserSettings: UserSettings!
|
||||
var userHooks: UserHooks {
|
||||
get { return underlyingUserHooks }
|
||||
set(value) { underlyingUserHooks = value }
|
||||
}
|
||||
nonisolated(unsafe) var underlyingUserHooks: UserHooks!
|
||||
var mediaProvider: MediaProviderProtocol {
|
||||
get { return underlyingMediaProvider }
|
||||
set(value) { underlyingMediaProvider = value }
|
||||
|
||||
@@ -12,6 +12,7 @@ import Foundation
|
||||
struct UserSessionMockConfiguration {
|
||||
var clientProxy: ClientProxyProtocol = ClientProxyMock(.init())
|
||||
var userSettings: UserSettings = .mock()
|
||||
var userHooks = UserHooks()
|
||||
var contentScannerService: ContentScannerServiceProtocol?
|
||||
var liveLocationManager: LiveLocationManagerProtocol = LiveLocationManagerMock(.init())
|
||||
}
|
||||
@@ -22,6 +23,7 @@ struct UserSessionMockConfiguration {
|
||||
|
||||
clientProxy = configuration.clientProxy
|
||||
userSettings = configuration.userSettings
|
||||
userHooks = configuration.userHooks
|
||||
callbacks = .init()
|
||||
|
||||
mediaProvider = MediaProviderMock(.init())
|
||||
|
||||
@@ -16,7 +16,6 @@ struct CreateRoomScreenCoordinatorParameters {
|
||||
let userSession: UserSessionProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
let analytics: AnalyticsServiceProtocol
|
||||
let appHooks: AppHooks
|
||||
}
|
||||
|
||||
enum CreateRoomScreenCoordinatorAction {
|
||||
@@ -40,8 +39,7 @@ final class CreateRoomScreenCoordinator: CoordinatorProtocol {
|
||||
shouldShowCancelButton: parameters.shouldShowCancelButton,
|
||||
userSession: parameters.userSession,
|
||||
analytics: parameters.analytics,
|
||||
userIndicatorController: parameters.userIndicatorController,
|
||||
appHooks: parameters.appHooks)
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
func start() {
|
||||
|
||||
@@ -32,8 +32,7 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen
|
||||
shouldShowCancelButton: Bool,
|
||||
userSession: UserSessionProtocol,
|
||||
analytics: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol,
|
||||
appHooks: AppHooks) {
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.userSession = userSession
|
||||
mediaUploadingPreprocessor = MediaUploadingPreprocessor(userSettings: userSession.userSettings)
|
||||
self.analytics = analytics
|
||||
@@ -68,7 +67,7 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen
|
||||
aliasLocalPart: roomAliasNameFromRoomDisplayName(roomName: ""),
|
||||
bindings: bindings)
|
||||
|
||||
super.init(initialViewState: appHooks.createRoomScreenHook.update(viewState, homeserver: userSession.clientProxy.homeserver),
|
||||
super.init(initialViewState: userSession.userHooks.createRoomScreenHook.update(viewState, homeserver: userSession.clientProxy.homeserver),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
setupBindings()
|
||||
|
||||
@@ -466,7 +466,6 @@ struct CreateRoom_Previews: PreviewProvider, TestablePreview {
|
||||
shouldShowCancelButton: isSpace,
|
||||
userSession: userSession,
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +70,7 @@ struct CreateRoomSpaceSelectionSheet_Previews: PreviewProvider, TestablePreview
|
||||
shouldShowCancelButton: false,
|
||||
userSession: userSession,
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
@@ -12,7 +12,6 @@ import SwiftUI
|
||||
struct RoomDetailsScreenCoordinatorParameters {
|
||||
let roomProxy: JoinedRoomProxyProtocol
|
||||
let userSession: UserSessionProtocol
|
||||
let appHooks: AppHooks
|
||||
let analyticsService: AnalyticsServiceProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
let notificationSettings: NotificationSettingsProxyProtocol
|
||||
@@ -53,7 +52,6 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol {
|
||||
isSpace = parameters.roomProxy.infoPublisher.value.isSpace
|
||||
viewModel = RoomDetailsScreenViewModel(roomProxy: parameters.roomProxy,
|
||||
userSession: parameters.userSession,
|
||||
appHooks: parameters.appHooks,
|
||||
analyticsService: parameters.analyticsService,
|
||||
userIndicatorController: parameters.userIndicatorController,
|
||||
notificationSettingsProxy: parameters.notificationSettings,
|
||||
|
||||
@@ -45,7 +45,6 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
init(roomProxy: JoinedRoomProxyProtocol,
|
||||
userSession: UserSessionProtocol,
|
||||
appHooks: AppHooks,
|
||||
analyticsService: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol,
|
||||
notificationSettingsProxy: NotificationSettingsProxyProtocol,
|
||||
@@ -68,7 +67,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
notificationSettingsState: .loading,
|
||||
isNativeCallingEnabled: userSession.userSettings.app.nativeCallEnabled,
|
||||
bindings: .init())
|
||||
super.init(initialViewState: appHooks.roomDetailsScreenHook.update(viewState),
|
||||
super.init(initialViewState: userSession.userHooks.roomDetailsScreenHook.update(viewState),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
Task {
|
||||
|
||||
@@ -441,7 +441,6 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
return .init(roomProxy: roomProxy,
|
||||
userSession: UserSessionMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
notificationSettingsProxy: notificationSettingsProxy,
|
||||
@@ -469,7 +468,6 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
return .init(roomProxy: roomProxy,
|
||||
userSession: UserSessionMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
notificationSettingsProxy: notificationSettingsProxy,
|
||||
@@ -507,7 +505,6 @@ struct RoomDetailsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
return .init(roomProxy: roomProxy,
|
||||
userSession: UserSessionMock(.init(clientProxy: clientProxyMock)),
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
notificationSettingsProxy: notificationSettingsProxy,
|
||||
|
||||
-2
@@ -13,7 +13,6 @@ struct RoomMemberDetailsScreenCoordinatorParameters {
|
||||
let userID: String
|
||||
let roomProxy: JoinedRoomProxyProtocol
|
||||
let userSession: UserSessionProtocol
|
||||
let appHooks: AppHooks
|
||||
let analytics: AnalyticsServiceProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
@@ -39,7 +38,6 @@ final class RoomMemberDetailsScreenCoordinator: CoordinatorProtocol {
|
||||
viewModel = RoomMemberDetailsScreenViewModel(userID: parameters.userID,
|
||||
roomProxy: parameters.roomProxy,
|
||||
userSession: parameters.userSession,
|
||||
appHooks: parameters.appHooks,
|
||||
analytics: parameters.analytics,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
init(userID: String,
|
||||
roomProxy: JoinedRoomProxyProtocol,
|
||||
userSession: UserSessionProtocol,
|
||||
appHooks: AppHooks,
|
||||
analytics: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.roomProxy = roomProxy
|
||||
@@ -38,7 +37,7 @@ class RoomMemberDetailsScreenViewModel: RoomMemberDetailsScreenViewModelType, Ro
|
||||
|
||||
let initialViewState = RoomMemberDetailsScreenViewState(userID: userID, bindings: .init())
|
||||
|
||||
super.init(initialViewState: appHooks.roomMemberDetailsScreenHook.update(initialViewState),
|
||||
super.init(initialViewState: userSession.userHooks.roomMemberDetailsScreenHook.update(initialViewState),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
showMemberLoadingIndicator()
|
||||
|
||||
@@ -239,7 +239,6 @@ struct RoomMemberDetailsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
return RoomMemberDetailsScreenViewModel(userID: member.userID,
|
||||
roomProxy: roomProxyMock,
|
||||
userSession: UserSessionMock(.init(clientProxy: clientProxyMock)),
|
||||
appHooks: AppHooks(),
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ struct RoomScreenCoordinatorParameters {
|
||||
let completionSuggestionService: CompletionSuggestionServiceProtocol
|
||||
let ongoingCallRoomIDPublisher: CurrentValuePublisher<String?, Never>
|
||||
let appMediator: AppMediatorProtocol
|
||||
let appHooks: AppHooks
|
||||
let analytics: AnalyticsServiceProtocol
|
||||
let composerDraftService: ComposerDraftServiceProtocol
|
||||
let timelineControllerFactory: TimelineControllerFactoryProtocol
|
||||
@@ -77,7 +76,6 @@ final class RoomScreenCoordinator: CoordinatorProtocol {
|
||||
roomProxy: parameters.roomProxy,
|
||||
initialSelectedPinnedEventID: selectedPinnedEventID,
|
||||
ongoingCallRoomIDPublisher: parameters.ongoingCallRoomIDPublisher,
|
||||
appHooks: parameters.appHooks,
|
||||
analyticsService: parameters.analytics,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
roomProxy: JoinedRoomProxyProtocol,
|
||||
initialSelectedPinnedEventID: String?,
|
||||
ongoingCallRoomIDPublisher: CurrentValuePublisher<String?, Never>,
|
||||
appHooks: AppHooks,
|
||||
analyticsService: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
clientProxy = userSession.clientProxy
|
||||
@@ -73,7 +72,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
isDM: roomProxy.infoPublisher.value.isDM,
|
||||
hasSuccessor: roomProxy.infoPublisher.value.successor != nil,
|
||||
roomHistorySharingState: roomProxy.infoPublisher.value.historySharingState)
|
||||
super.init(initialViewState: appHooks.roomScreenHook.update(viewState),
|
||||
super.init(initialViewState: userSession.userHooks.roomScreenHook.update(viewState),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
updateRoomInfo(roomProxy.infoPublisher.value)
|
||||
@@ -459,13 +458,11 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
|
||||
extension RoomScreenViewModel {
|
||||
static func mock(roomProxyMock: JoinedRoomProxyMock,
|
||||
clientProxyMock: ClientProxyMock = ClientProxyMock(.init()),
|
||||
appHooks: AppHooks = AppHooks()) -> RoomScreenViewModel {
|
||||
RoomScreenViewModel(userSession: UserSessionMock(.init(clientProxy: clientProxyMock)),
|
||||
userSession: UserSessionProtocol = UserSessionMock(.init())) -> RoomScreenViewModel {
|
||||
RoomScreenViewModel(userSession: userSession,
|
||||
roomProxy: roomProxyMock,
|
||||
initialSelectedPinnedEventID: nil,
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appHooks: appHooks,
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
|
||||
+1
-3
@@ -13,7 +13,6 @@ struct SecurityAndPrivacyScreenCoordinatorParameters {
|
||||
let roomProxy: JoinedRoomProxyProtocol
|
||||
let userSession: UserSessionProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
let appHooks: AppHooks
|
||||
}
|
||||
|
||||
enum SecurityAndPrivacyScreenCoordinatorAction {
|
||||
@@ -35,8 +34,7 @@ final class SecurityAndPrivacyScreenCoordinator: CoordinatorProtocol {
|
||||
init(parameters: SecurityAndPrivacyScreenCoordinatorParameters) {
|
||||
viewModel = SecurityAndPrivacyScreenViewModel(roomProxy: parameters.roomProxy,
|
||||
userSession: parameters.userSession,
|
||||
userIndicatorController: parameters.userIndicatorController,
|
||||
appHooks: parameters.appHooks)
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
func start() {
|
||||
|
||||
+2
-3
@@ -25,8 +25,7 @@ class SecurityAndPrivacyScreenViewModel: SecurityAndPrivacyScreenViewModelType,
|
||||
|
||||
init(roomProxy: JoinedRoomProxyProtocol,
|
||||
userSession: UserSessionProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol,
|
||||
appHooks: AppHooks) {
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.roomProxy = roomProxy
|
||||
clientProxy = userSession.clientProxy
|
||||
self.userIndicatorController = userIndicatorController
|
||||
@@ -39,7 +38,7 @@ class SecurityAndPrivacyScreenViewModel: SecurityAndPrivacyScreenViewModelType,
|
||||
isKnockingEnabled: userSettings.app.knockingEnabled,
|
||||
historySharingDetailsURL: userSettings.app.historySharingDetailsURL)
|
||||
|
||||
super.init(initialViewState: appHooks.securityAndPrivacyScreenHook.update(viewState, homeserver: clientProxy.homeserver))
|
||||
super.init(initialViewState: userSession.userHooks.securityAndPrivacyScreenHook.update(viewState, homeserver: clientProxy.homeserver))
|
||||
|
||||
if let powerLevels = roomProxy.infoPublisher.value.powerLevels {
|
||||
setupPermissions(powerLevels: powerLevels)
|
||||
|
||||
+9
-18
@@ -234,8 +234,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let inviteOnlyViewModel = SecurityAndPrivacyScreenViewModel(roomProxy: JoinedRoomProxyMock(.init(members: .allMembersAsCreator,
|
||||
joinRule: .invite)),
|
||||
userSession: UserSessionMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
static let publicViewModel = SecurityAndPrivacyScreenViewModel(roomProxy: JoinedRoomProxyMock(.init(isEncrypted: false,
|
||||
canonicalAlias: "#room:matrix.org",
|
||||
@@ -243,15 +242,13 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
joinRule: .public,
|
||||
isVisibleInPublicDirectory: true)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org")))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
static let publicNoAddressViewModel = SecurityAndPrivacyScreenViewModel(roomProxy: JoinedRoomProxyMock(.init(isEncrypted: false,
|
||||
members: .allMembersAsCreator,
|
||||
joinRule: .public)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org")))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
static let singleSpaceMembersViewModel = {
|
||||
let space = [SpaceServiceRoom].mockSingleRoom[0]
|
||||
@@ -263,8 +260,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
isVisibleInPublicDirectory: true)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org",
|
||||
spaceServiceConfiguration: .init(joinedParentSpaces: [space]))))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static let multipleSpacesMembersViewModel = {
|
||||
@@ -277,8 +273,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
isVisibleInPublicDirectory: true)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org",
|
||||
spaceServiceConfiguration: .init(joinedParentSpaces: spaces))))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static let askToJoinViewModel = {
|
||||
@@ -292,8 +287,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
isVisibleInPublicDirectory: true)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org")),
|
||||
userSettings: userSettings)),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static let singleAskToJoinSpaceMembersViewModel = {
|
||||
@@ -310,8 +304,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org",
|
||||
spaceServiceConfiguration: .init(joinedParentSpaces: [space]))),
|
||||
userSettings: userSettings)),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static let multipleAskToJoinSpacesMembersViewModel = {
|
||||
@@ -328,8 +321,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org",
|
||||
spaceServiceConfiguration: .init(joinedParentSpaces: spaces))),
|
||||
userSettings: userSettings)),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
static let publicSpaceViewModel = SecurityAndPrivacyScreenViewModel(roomProxy: JoinedRoomProxyMock(.init(isSpace: true,
|
||||
@@ -339,8 +331,7 @@ struct SecurityAndPrivacyScreen_Previews: PreviewProvider, TestablePreview {
|
||||
joinRule: .public,
|
||||
isVisibleInPublicDirectory: true)),
|
||||
userSession: UserSessionMock(.init(clientProxy: ClientProxyMock(.init(userIDServerName: "matrix.org")))),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
appHooks: AppHooks())
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
static var previews: some View {
|
||||
ElementNavigationStack {
|
||||
|
||||
@@ -132,7 +132,6 @@ struct SpaceSettingsScreen_Previews: PreviewProvider, TestablePreview {
|
||||
canonicalAlias: "#space:matrix.org",
|
||||
members: members)),
|
||||
userSession: UserSessionMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()),
|
||||
|
||||
@@ -13,7 +13,6 @@ struct UserProfileScreenCoordinatorParameters {
|
||||
let userID: String
|
||||
let isPresentedModally: Bool
|
||||
let userSession: UserSessionProtocol
|
||||
let appHooks: AppHooks
|
||||
let analytics: AnalyticsServiceProtocol
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
@@ -38,7 +37,6 @@ final class UserProfileScreenCoordinator: CoordinatorProtocol {
|
||||
viewModel = UserProfileScreenViewModel(userID: parameters.userID,
|
||||
isPresentedModally: parameters.isPresentedModally,
|
||||
userSession: parameters.userSession,
|
||||
appHooks: parameters.appHooks,
|
||||
analytics: parameters.analytics,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ class UserProfileScreenViewModel: UserProfileScreenViewModelType, UserProfileScr
|
||||
init(userID: String,
|
||||
isPresentedModally: Bool,
|
||||
userSession: UserSessionProtocol,
|
||||
appHooks: AppHooks,
|
||||
analytics: AnalyticsServiceProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.userSession = userSession
|
||||
@@ -37,7 +36,7 @@ class UserProfileScreenViewModel: UserProfileScreenViewModelType, UserProfileScr
|
||||
isPresentedModally: isPresentedModally,
|
||||
bindings: .init())
|
||||
|
||||
super.init(initialViewState: appHooks.userProfileScreenHook.update(initialViewState),
|
||||
super.init(initialViewState: userSession.userHooks.userProfileScreenHook.update(initialViewState),
|
||||
mediaProvider: userSession.mediaProvider)
|
||||
|
||||
showLoadingIndicator(allowsInteraction: true)
|
||||
|
||||
@@ -147,7 +147,6 @@ struct UserProfileScreen_Previews: PreviewProvider, TestablePreview {
|
||||
return UserProfileScreenViewModel(userID: userID,
|
||||
isPresentedModally: false,
|
||||
userSession: UserSessionMock(.init(clientProxy: clientProxyMock)),
|
||||
appHooks: AppHooks(),
|
||||
analytics: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ class UserSession: UserSessionProtocol {
|
||||
|
||||
let clientProxy: ClientProxyProtocol
|
||||
let userSettings: UserSettings
|
||||
let userHooks: UserHooks
|
||||
|
||||
let mediaProvider: MediaProviderProtocol
|
||||
let voiceMessageMediaManager: VoiceMessageMediaManagerProtocol
|
||||
@@ -32,11 +33,13 @@ class UserSession: UserSessionProtocol {
|
||||
|
||||
init(clientProxy: ClientProxyProtocol,
|
||||
userSettings: UserSettings,
|
||||
userHooks: UserHooks,
|
||||
mediaProvider: MediaProviderProtocol,
|
||||
voiceMessageMediaManager: VoiceMessageMediaManagerProtocol,
|
||||
liveLocationManager: LiveLocationManagerProtocol) {
|
||||
self.clientProxy = clientProxy
|
||||
self.userSettings = userSettings
|
||||
self.userHooks = userHooks
|
||||
|
||||
self.mediaProvider = mediaProvider
|
||||
self.voiceMessageMediaManager = voiceMessageMediaManager
|
||||
|
||||
@@ -22,6 +22,7 @@ struct SessionSecurityState: Equatable {
|
||||
protocol UserSessionProtocol: Sendable {
|
||||
var clientProxy: ClientProxyProtocol { get }
|
||||
var userSettings: UserSettings { get }
|
||||
var userHooks: UserHooks { get }
|
||||
|
||||
var mediaProvider: MediaProviderProtocol { get }
|
||||
var voiceMessageMediaManager: VoiceMessageMediaManagerProtocol { get }
|
||||
|
||||
@@ -126,6 +126,7 @@ class UserSessionStore: UserSessionStoreProtocol {
|
||||
|
||||
return UserSession(clientProxy: clientProxy,
|
||||
userSettings: userSettings,
|
||||
userHooks: appHooks.userSessionHook.makeUserHooks(for: clientProxy),
|
||||
mediaProvider: mediaProvider,
|
||||
voiceMessageMediaManager: voiceMessageMediaManager,
|
||||
liveLocationManager: liveLocationManager)
|
||||
|
||||
@@ -303,7 +303,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()),
|
||||
@@ -323,7 +322,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()),
|
||||
@@ -343,7 +341,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -362,7 +359,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -387,7 +383,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -412,7 +407,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()), timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
let coordinator = RoomScreenCoordinator(parameters: parameters)
|
||||
@@ -436,7 +430,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -462,7 +455,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -487,7 +479,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -508,7 +499,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -542,7 +532,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -563,7 +552,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -584,7 +572,6 @@ class MockScreen: Identifiable {
|
||||
completionSuggestionService: CompletionSuggestionServiceMock(configuration: .init()),
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appMediator: AppMediatorMock(.init()),
|
||||
appHooks: AppHooks(),
|
||||
analytics: analytics,
|
||||
composerDraftService: ComposerDraftServiceMock(.init()),
|
||||
timelineControllerFactory: TimelineControllerFactoryMock(.init()), userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -741,7 +728,6 @@ class MockScreen: Identifiable {
|
||||
navigationStackCoordinator.setRootCoordinator(BlankFormCoordinator())
|
||||
|
||||
let coordinator = EncryptionSettingsFlowCoordinator(parameters: .init(userSession: userSession,
|
||||
appHooks: AppHooks(),
|
||||
userIndicatorController: UserIndicatorControllerMock(),
|
||||
navigationStackCoordinator: navigationStackCoordinator))
|
||||
retainedState.append(coordinator)
|
||||
|
||||
Reference in New Issue
Block a user