mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add hooks for the RoomDetails, RoomMemberDetails and UserProfile screens. (#5980)
Also adds an @AppHook macro.
This commit is contained in:
@@ -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 RoomDetailsScreenHookProtocol: Sendable {
|
||||
@MainActor func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState
|
||||
}
|
||||
|
||||
struct DefaultRoomDetailsScreenHook: RoomDetailsScreenHookProtocol {
|
||||
func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState {
|
||||
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 RoomMemberDetailsScreenHookProtocol: Sendable {
|
||||
@MainActor func update(_ viewState: RoomMemberDetailsScreenViewState) -> RoomMemberDetailsScreenViewState
|
||||
}
|
||||
|
||||
struct DefaultRoomMemberDetailsScreenHook: RoomMemberDetailsScreenHookProtocol {
|
||||
func update(_ viewState: RoomMemberDetailsScreenViewState) -> RoomMemberDetailsScreenViewState {
|
||||
viewState
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,10 @@
|
||||
import Foundation
|
||||
|
||||
nonisolated protocol RoomScreenHookProtocol: Sendable {
|
||||
@MainActor func configure(with userSession: UserSessionProtocol?) async
|
||||
@MainActor func update(_ viewState: RoomScreenViewState) -> RoomScreenViewState
|
||||
}
|
||||
|
||||
struct DefaultRoomScreenHook: RoomScreenHookProtocol {
|
||||
func configure(with userSession: UserSessionProtocol?) async { }
|
||||
func update(_ viewState: RoomScreenViewState) -> RoomScreenViewState {
|
||||
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 UserProfileScreenHookProtocol: Sendable {
|
||||
@MainActor func update(_ viewState: UserProfileScreenViewState) -> UserProfileScreenViewState
|
||||
}
|
||||
|
||||
struct DefaultUserProfileScreenHook: UserProfileScreenHookProtocol {
|
||||
func update(_ viewState: UserProfileScreenViewState) -> UserProfileScreenViewState {
|
||||
viewState
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// 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 {
|
||||
func configure(with userSession: UserSessionProtocol?) async
|
||||
}
|
||||
|
||||
nonisolated struct DefaultUserSessionHook: UserSessionHookProtocol {
|
||||
func configure(with userSession: UserSessionProtocol?) async { }
|
||||
}
|
||||
Reference in New Issue
Block a user