change (room avatar) : expose isTombstone where we need to display the RoomAvatar

This commit is contained in:
ganfra 2025-06-13 18:39:51 +02:00
parent 451579594e
commit f47c0f648b
10 changed files with 23 additions and 1 deletions

View file

@ -67,6 +67,7 @@ class RoomListRoomSummaryFactory @Inject constructor(
heroes = roomInfo.heroes.map { user ->
user.getAvatarData(size = AvatarSize.RoomListItem)
}.toImmutableList(),
isTombstoned = roomInfo.successorRoom != null,
)
}
}

View file

@ -36,6 +36,7 @@ data class RoomListRoomSummary(
val isDm: Boolean,
val isFavorite: Boolean,
val inviteSender: InviteSender?,
val isTombstoned: Boolean,
val heroes: ImmutableList<AvatarData>,
) {
val isHighlighted = userDefinedNotificationMode != RoomNotificationMode.MUTE &&

View file

@ -110,6 +110,11 @@ open class RoomListRoomSummaryProvider : PreviewParameterProvider<RoomListRoomSu
name = "A knocked room with alias",
canonicalAlias = RoomAlias("#knockable:matrix.org"),
displayType = RoomSummaryDisplayType.KNOCKED,
),
aRoomListRoomSummary(
name = "A tombstoned room",
displayType = RoomSummaryDisplayType.ROOM,
isTombstoned = true,
)
),
).flatten()
@ -145,6 +150,7 @@ internal fun aRoomListRoomSummary(
displayType: RoomSummaryDisplayType = RoomSummaryDisplayType.ROOM,
canonicalAlias: RoomAlias? = null,
heroes: List<AvatarData> = emptyList(),
isTombstoned: Boolean = false,
) = RoomListRoomSummary(
id = id,
roomId = RoomId(id),
@ -165,4 +171,5 @@ internal fun aRoomListRoomSummary(
displayType = displayType,
canonicalAlias = canonicalAlias,
heroes = heroes.toImmutableList(),
isTombstoned = isTombstoned,
)

View file

@ -84,6 +84,7 @@ internal fun createRoomListRoomSummary(
displayType: RoomSummaryDisplayType = RoomSummaryDisplayType.ROOM,
heroes: List<AvatarData> = emptyList(),
timestamp: String? = null,
isTombstoned: Boolean = false,
) = RoomListRoomSummary(
id = A_ROOM_ID.value,
roomId = A_ROOM_ID,
@ -104,4 +105,5 @@ internal fun createRoomListRoomSummary(
inviteSender = null,
isDm = false,
heroes = heroes.toPersistentList(),
isTombstoned = isTombstoned,
)