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:
Doug
2026-10-15 10:49:27 +01:00
committed by GitHub
parent 11b6cc3f70
commit b6ccbbc6c3
45 changed files with 90 additions and 168 deletions
@@ -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)
}
@@ -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())
}