Extend the room details screen hook (#6173)

* Allow Enterprise sections in room details

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>

* Update the Enterprise submodule and strings

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>

---------

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
This commit is contained in:
Danny
2026-09-28 12:11:23 -06:00
committed by GitHub
parent e51d869fdc
commit d74d53e4ee
8 changed files with 26 additions and 3 deletions
@@ -1322,6 +1322,9 @@
"screen_room_details_profile_row_title" = "Profile";
"screen_room_details_requests_to_join_title" = "Requests to join";
"screen_room_details_roles_and_permissions" = "Roles & permissions";
"screen_room_details_room_audio_ptt" = "Push to talk";
"screen_room_details_room_audio_title" = "Room Audio";
"screen_room_details_room_audio_video_calls" = "Video calls";
"screen_room_details_room_name_label" = "Name";
"screen_room_details_security_and_privacy_title" = "Security & privacy";
"screen_room_details_security_title" = "Security";
@@ -1322,6 +1322,9 @@
"screen_room_details_profile_row_title" = "Profile";
"screen_room_details_requests_to_join_title" = "Requests to join";
"screen_room_details_roles_and_permissions" = "Roles & permissions";
"screen_room_details_room_audio_ptt" = "Push to talk";
"screen_room_details_room_audio_title" = "Room Audio";
"screen_room_details_room_audio_video_calls" = "Video calls";
"screen_room_details_room_name_label" = "Name";
"screen_room_details_security_and_privacy_title" = "Security & privacy";
"screen_room_details_security_title" = "Security";
@@ -5,14 +5,19 @@
// Please see LICENSE files in the repository root for full details.
//
import Foundation
import SwiftUI
nonisolated protocol RoomDetailsScreenHookProtocol: Sendable {
@MainActor func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState
@MainActor func additionalSections() -> AnyView?
}
struct DefaultRoomDetailsScreenHook: RoomDetailsScreenHookProtocol {
func update(_ viewState: RoomDetailsScreenViewState) -> RoomDetailsScreenViewState {
viewState
}
func additionalSections() -> AnyView? {
nil
}
}
+6
View File
@@ -3062,6 +3062,12 @@ internal nonisolated enum L10n {
internal static var screenRoomDetailsRequestsToJoinTitle: String { return L10n.tr("Localizable", "screen_room_details_requests_to_join_title") }
/// Roles & permissions
internal static var screenRoomDetailsRolesAndPermissions: String { return L10n.tr("Localizable", "screen_room_details_roles_and_permissions") }
/// Push to talk
internal static var screenRoomDetailsRoomAudioPtt: String { return L10n.tr("Localizable", "screen_room_details_room_audio_ptt") }
/// Room Audio
internal static var screenRoomDetailsRoomAudioTitle: String { return L10n.tr("Localizable", "screen_room_details_room_audio_title") }
/// Video calls
internal static var screenRoomDetailsRoomAudioVideoCalls: String { return L10n.tr("Localizable", "screen_room_details_room_audio_video_calls") }
/// Name
internal static var screenRoomDetailsRoomNameLabel: String { return L10n.tr("Localizable", "screen_room_details_room_name_label") }
/// Security & privacy
@@ -40,6 +40,7 @@ struct DMRecipientInfo {
}
struct RoomDetailsScreenViewState: BindableState {
let appHooks: AppHooks
var details: RoomDetails
var isEncrypted: Bool
@@ -60,7 +60,8 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
let topic = attributedStringBuilder.fromPlain(roomProxy.infoPublisher.value.topic)
let viewState = RoomDetailsScreenViewState(details: roomProxy.details,
let viewState = RoomDetailsScreenViewState(appHooks: appHooks,
details: roomProxy.details,
isEncrypted: roomProxy.infoPublisher.value.isEncrypted,
isDirect: roomProxy.infoPublisher.value.isDirect,
topic: topic,
@@ -20,6 +20,10 @@ struct RoomDetailsScreen: View {
topicSection
context.viewState.appHooks
.roomDetailsScreenHook
.additionalSections()
aboutSection
// The invitation flow is different for DMs