diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt index ec805731ec..232f4d626c 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsPresenter.kt @@ -205,6 +205,7 @@ class RoomDetailsPresenter( canReportRoom = canReportRoom, isTombstoned = roomInfo.successorRoom != null, showDebugInfo = isDeveloperModeEnabled, + roomVersion = roomInfo.roomVersion, eventSink = ::handleEvent, ) } diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt index 6e8d563d4a..2332776e96 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsState.kt @@ -49,6 +49,7 @@ data class RoomDetailsState( val canReportRoom: Boolean, val isTombstoned: Boolean, val showDebugInfo: Boolean, + val roomVersion: String?, val eventSink: (RoomDetailsEvent) -> Unit ) { val roomBadges = buildList { diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt index cbb54071a1..783fcfaf10 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsStateProvider.kt @@ -146,6 +146,7 @@ fun aRoomDetailsState( canReportRoom = canReportRoom, isTombstoned = isTombstoned, showDebugInfo = showDebugInfo, + roomVersion = "12", eventSink = eventSink, ) diff --git a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt index fe4a002af8..de0a2cba1b 100644 --- a/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt +++ b/features/roomdetails/impl/src/main/kotlin/io/element/android/features/roomdetails/impl/RoomDetailsView.kt @@ -264,6 +264,7 @@ fun RoomDetailsView( if (state.showDebugInfo) { DebugInfoSection( roomId = state.roomId, + roomVersion = state.roomVersion, ) } } @@ -714,7 +715,10 @@ private fun OtherActionsSection( } @Composable -private fun DebugInfoSection(roomId: RoomId) { +private fun DebugInfoSection( + roomId: RoomId, + roomVersion: String?, +) { val context = LocalContext.current PreferenceCategory(showTopDivider = true) { ListItem( @@ -737,6 +741,19 @@ private fun DebugInfoSection(roomId: RoomId) { ) }, ) + ListItem( + headlineContent = { + Text("Room version") + }, + supportingContent = { + Text( + text = roomVersion ?: "Unknown", + style = ElementTheme.typography.fontBodySmRegular, + color = ElementTheme.colors.textSecondary, + ) + }, + leadingContent = ListItemContent.Icon(IconSource.Vector(CompoundIcons.Info())), + ) } }