From cd4c76514371b9a4e677d9c87302da976b75e689 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 4 Sep 2025 14:35:28 +0200 Subject: [PATCH] Code quality --- .../android/features/home/impl/spaces/HomeSpaceItemView.kt | 4 ++-- .../android/features/home/impl/spaces/HomeSpacesEvents.kt | 4 +--- .../android/features/home/impl/spaces/HomeSpacesPresenter.kt | 2 +- .../atomic/molecules/InviteButtonsRowMolecule.kt | 1 - .../android/libraries/matrix/impl/RustMatrixClient.kt | 5 ----- .../android/libraries/matrix/impl/spaces/RustSpaceService.kt | 4 +--- .../libraries/matrix/ui/components/SpaceHeaderView.kt | 3 ++- 7 files changed, 7 insertions(+), 16 deletions(-) diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpaceItemView.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpaceItemView.kt index 0e49d67343..461c550d8e 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpaceItemView.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpaceItemView.kt @@ -120,7 +120,7 @@ internal fun HomeSpaceItemView( } @Composable -fun NameAndIndicatorRow( +private fun NameAndIndicatorRow( name: String?, showIndicator: Boolean, modifier: Modifier = Modifier, @@ -152,8 +152,8 @@ private fun SpaceScaffoldRow( spaceRoom: SpaceRoom, onClick: () -> Unit, onLongClick: () -> Unit, - modifier: Modifier = Modifier, hideAvatars: Boolean, + modifier: Modifier = Modifier, content: @Composable ColumnScope.() -> Unit ) { val clickModifier = Modifier diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesEvents.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesEvents.kt index dab1d05944..5d07a5e358 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesEvents.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesEvents.kt @@ -7,6 +7,4 @@ package io.element.android.features.home.impl.spaces -sealed interface HomeSpacesEvents { - -} +sealed interface HomeSpacesEvents diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesPresenter.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesPresenter.kt index 6be8633f7f..138fbbd0bc 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesPresenter.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/spaces/HomeSpacesPresenter.kt @@ -39,7 +39,7 @@ class HomeSpacesPresenter @Inject constructor( }.collectAsState(persistentSetOf()) fun handleEvents(event: HomeSpacesEvents) { - //when (event) { } + // when (event) { } } return HomeSpacesState( diff --git a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/InviteButtonsRowMolecule.kt b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/InviteButtonsRowMolecule.kt index 62346fb092..85d938d3be 100644 --- a/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/InviteButtonsRowMolecule.kt +++ b/libraries/designsystem/src/main/kotlin/io/element/android/libraries/designsystem/atomic/molecules/InviteButtonsRowMolecule.kt @@ -44,4 +44,3 @@ fun InviteButtonsRowMolecule( ) } } - diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt index f4b64daf59..e193d8f37d 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt @@ -191,11 +191,6 @@ class RustMatrixClient( innerSpaceService = innerSpaceService, sessionCoroutineScope = sessionCoroutineScope, sessionDispatcher = sessionDispatcher, - //roomListFactory = RoomListFactory( - // innerRoomListService = innerRoomListService, - // sessionCoroutineScope = sessionCoroutineScope, - //), - //roomSyncSubscriber = roomSyncSubscriber, ) private val verificationService = RustSessionVerificationService( diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/spaces/RustSpaceService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/spaces/RustSpaceService.kt index 03367daae1..b059d476bc 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/spaces/RustSpaceService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/spaces/RustSpaceService.kt @@ -84,9 +84,7 @@ class RustSpaceService( private fun MutableList.applyUpdate(update: SpaceListUpdate) { when (update) { is SpaceListUpdate.Append -> { - val newSpaces = update.values.map { it -> - it.let(mapper::map) - } + val newSpaces = update.values.map(mapper::map) addAll(newSpaces) } SpaceListUpdate.Clear -> clear() diff --git a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SpaceHeaderView.kt b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SpaceHeaderView.kt index 8c3f1c51bd..11e9f37c8b 100644 --- a/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SpaceHeaderView.kt +++ b/libraries/matrixui/src/main/kotlin/io/element/android/libraries/matrix/ui/components/SpaceHeaderView.kt @@ -66,11 +66,12 @@ fun SpaceHeaderView( textAlign = TextAlign.Center, ) } - if (joinRule != null) + if (joinRule != null) { SpaceInfoRow( joinRule = joinRule, numberOfRooms = numberOfRooms, ) + } SpaceMembersView( heroes = heroes, numberOfMembers = numberOfMembers,