Files
element-x-ios/ElementX/Sources/AppHooks/AppHooks.swift
T
joel.poyet a838a03a1f Adapt the HealthChat hooks to the upstream 26.09.1 screen APIs
The rebase onto release/26.09.1 moved three things the fork depends on.

Upstream now owns a UserProfileScreenHook of its own (#5980), which rewrites a
screen's view state rather than injecting a view. The fork's section hook keeps
its behaviour under the fork-only name ExtendedProfileSectionHook, so both can
live side by side and upstream's file stays untouched. Upstream's new @AppHook
macro generates the same register<Name> methods, so registration is unchanged.

UserProfileScreenCoordinatorParameters lost appSettings and reordered its
arguments, and UserDetailsEditScreenCoordinator now publishes its own
UserDetailsEditScreenCoordinatorAction instead of borrowing the room one
(#5893). The members flow and the profile editor follow both.

AppSettings.override gained oAuthClientURIPath (#5934), whose default appends
apps/ios to the website URL. HealthChat passes nil to keep the registered
client_uri at https://healthchat.ch exactly as the shipped build has it —
changing what the app registers with MAS is not a side effect a rebase should
have.
2026-09-22 18:46:08 +02:00

82 lines
2.7 KiB
Swift

//
// Copyright 2025 Element Creations Ltd.
// Copyright 2024-2025 New Vector 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
import Macros
import Synchronization
final nonisolated class AppHooks: AppHooksProtocol {
#if IS_MAIN_APP
func configure(with userSession: UserSessionProtocol?) async {
await userSessionHook.configure(with: userSession)
await extendedProfileSectionHook.configure(with: userSession)
}
@AppHook(default: DefaultAppSettingsHook())
var appSettingsHook: AppSettingsHookProtocol
@AppHook(default: DefaultCompoundHook())
var compoundHook: CompoundHookProtocol
@AppHook(default: DefaultBugReportHook())
var bugReportHook: BugReportHookProtocol
@AppHook(default: DefaultOAuthPresenterHook())
var oAuthPresenterHook: OAuthPresenterHookProtocol
@AppHook(default: DefaultUserSessionHook())
var userSessionHook: UserSessionHookProtocol
@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: DefaultExtendedProfileSectionHook())
var extendedProfileSectionHook: ExtendedProfileSectionHookProtocol
@AppHook(default: DefaultHomeTabsHook())
var homeTabsHook: HomeTabsHookProtocol
@AppHook(default: DefaultUserDetailsEditScreenHook())
var userDetailsEditScreenHook: UserDetailsEditScreenHookProtocol
@AppHook(default: DefaultDeveloperOptionsScreenHook())
var developerOptionsScreenHook: DeveloperOptionsScreenHookProtocol
@AppHook(default: DefaultRecoveryKeyScreenHook())
var recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol
#endif
@AppHook(default: DefaultTracingHook())
var tracingHook: TracingHookProtocol
@AppHook(default: DefaultClientFactoryHook())
var clientFactoryHook: ClientFactoryHookProtocol
@AppHook(default: DefaultRemoteSettingsHook())
var remoteSettingsHook: RemoteSettingsHookProtocol
}
nonisolated protocol AppHooksProtocol: Sendable {
// periphery:ignore - required for the architecture
func setUp()
}
nonisolated extension AppHooksProtocol {
// periphery:ignore - required for the architecture
func setUp() { }
}