Files
element-x-ios/ElementX/Sources/AppHooks/Hooks/UserSessionHook.swift
Doug b6ccbbc6c3 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.
2026-10-15 10:49:27 +01:00

29 lines
835 B
Swift

//
// 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 MatrixRustSDK
nonisolated protocol UserSessionHookProtocol: Sendable {
#if IS_MAIN_APP
@MainActor func makeUserHooks(for clientProxy: ClientProxyProtocol) -> UserHooks
#endif
func configure(_ userSettings: UserSettings, forHomeserver homeserver: String) -> UserSettings
}
nonisolated struct DefaultUserSessionHook: UserSessionHookProtocol {
#if IS_MAIN_APP
func makeUserHooks(for clientProxy: ClientProxyProtocol) -> UserHooks {
UserHooks()
}
#endif
func configure(_ userSettings: UserSettings, forHomeserver homeserver: String) -> UserSettings {
userSettings
}
}