diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomSummaryRow.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomSummaryRow.kt index 3036865eea..c5e1798baa 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomSummaryRow.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/components/RoomSummaryRow.kt @@ -189,10 +189,14 @@ private fun RoomSummaryScaffoldRow( ) { Avatar( avatarData = room.avatarData, - avatarType = AvatarType.Room( - heroes = room.heroes, - isTombstoned = room.isTombstoned, - ), + avatarType = if (room.isSpace) { + AvatarType.Space(isTombstoned = room.isTombstoned) + } else { + AvatarType.Room( + heroes = room.heroes, + isTombstoned = room.isTombstoned, + ) + }, hideImage = hideAvatarImage, ) Spacer(modifier = Modifier.width(16.dp)) diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/datasource/RoomListRoomSummaryFactory.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/datasource/RoomListRoomSummaryFactory.kt index b6f908fd5d..ffd6f640ac 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/datasource/RoomListRoomSummaryFactory.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/datasource/RoomListRoomSummaryFactory.kt @@ -69,6 +69,7 @@ class RoomListRoomSummaryFactory( user.getAvatarData(size = AvatarSize.RoomListItem) }.toImmutableList(), isTombstoned = roomInfo.successorRoom != null, + isSpace = roomInfo.isSpace, ) } } diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummary.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummary.kt index 3f166a66b4..8af359d3e5 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummary.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummary.kt @@ -38,6 +38,7 @@ data class RoomListRoomSummary( val inviteSender: InviteSender?, val isTombstoned: Boolean, val heroes: ImmutableList, + val isSpace: Boolean, ) { val isHighlighted = userDefinedNotificationMode != RoomNotificationMode.MUTE && (numberOfUnreadNotifications > 0 || numberOfUnreadMentions > 0) || diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummaryProvider.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummaryProvider.kt index f06e5a1a27..1e763843af 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummaryProvider.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/RoomListRoomSummaryProvider.kt @@ -102,6 +102,15 @@ open class RoomListRoomSummaryProvider : PreviewParameterProvider = emptyList(), isTombstoned: Boolean = false, + isSpace: Boolean = false, ) = RoomListRoomSummary( id = id, roomId = RoomId(id), @@ -172,4 +182,5 @@ internal fun aRoomListRoomSummary( canonicalAlias = canonicalAlias, heroes = heroes.toImmutableList(), isTombstoned = isTombstoned, + isSpace = isSpace ) diff --git a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/model/RoomListBaseRoomSummaryTest.kt b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/model/RoomListBaseRoomSummaryTest.kt index 55b3f1ffee..4f9b047990 100644 --- a/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/model/RoomListBaseRoomSummaryTest.kt +++ b/features/home/impl/src/test/kotlin/io/element/android/features/home/impl/model/RoomListBaseRoomSummaryTest.kt @@ -85,6 +85,7 @@ internal fun createRoomListRoomSummary( heroes: List = emptyList(), timestamp: String? = null, isTombstoned: Boolean = false, + isSpace: Boolean = false, ) = RoomListRoomSummary( id = A_ROOM_ID.value, roomId = A_ROOM_ID, @@ -106,4 +107,5 @@ internal fun createRoomListRoomSummary( isDm = false, heroes = heroes.toPersistentList(), isTombstoned = isTombstoned, + isSpace = isSpace )