Add hooks for room creation and privacy & security settings screen. (#6270)

Add hooks for the create room and security and privacy screens.
This commit is contained in:
mxandreas
2026-10-06 12:05:49 +03:00
committed by GitHub
parent 60c11c8172
commit 4640f9cec0
19 changed files with 131 additions and 40 deletions
+6
View File
@@ -48,6 +48,12 @@ final nonisolated class AppHooks: AppHooksProtocol {
@AppHook(default: DefaultRecoveryKeyScreenHook())
var recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol
@AppHook(default: DefaultCreateRoomScreenHook())
var createRoomScreenHook: CreateRoomScreenHookProtocol
@AppHook(default: DefaultSecurityAndPrivacyScreenHook())
var securityAndPrivacyScreenHook: SecurityAndPrivacyScreenHookProtocol
#endif
@AppHook(default: DefaultTracingHook())
@@ -0,0 +1,18 @@
//
// 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 protocol CreateRoomScreenHookProtocol: Sendable {
@MainActor func update(_ viewState: CreateRoomScreenViewState, homeserver: String) -> CreateRoomScreenViewState
}
struct DefaultCreateRoomScreenHook: CreateRoomScreenHookProtocol {
func update(_ viewState: CreateRoomScreenViewState, homeserver: String) -> CreateRoomScreenViewState {
viewState
}
}
@@ -0,0 +1,18 @@
//
// 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 protocol SecurityAndPrivacyScreenHookProtocol: Sendable {
@MainActor func update(_ viewState: SecurityAndPrivacyScreenViewState, homeserver: String) -> SecurityAndPrivacyScreenViewState
}
struct DefaultSecurityAndPrivacyScreenHook: SecurityAndPrivacyScreenHookProtocol {
func update(_ viewState: SecurityAndPrivacyScreenViewState, homeserver: String) -> SecurityAndPrivacyScreenViewState {
viewState
}
}