From 89e528d5527a707c2fbf82c2918cbfc3333e51e5 Mon Sep 17 00:00:00 2001 From: ericdecanini Date: Tue, 7 Jun 2022 10:10:22 +0200 Subject: [PATCH] Changes space subtitle in explore rooms from joined string to direct space parent --- .../app/features/home/room/list/RoomSummaryItemFactory.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt index 0526af367a..9b0427792f 100644 --- a/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt +++ b/vector/src/main/java/im/vector/app/features/home/room/list/RoomSummaryItemFactory.kt @@ -207,9 +207,7 @@ class RoomSummaryItemFactory @Inject constructor( private fun getSearchResultSubtitle(roomSummary: RoomSummary): String { val userId = roomSummary.directUserId - val spaceName = roomSummary.flattenParents - .takeIf { it.isNotEmpty() } - ?.joinToString(", ") { it.name } + val spaceName = roomSummary.flattenParents.lastOrNull()?.name val canonicalAlias = roomSummary.canonicalAlias return (userId ?: spaceName ?: canonicalAlias).orEmpty()