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

@ -30,10 +30,12 @@ fun aSelectRoomInfo(
canonicalAlias: RoomAlias? = null,
avatarUrl: String? = null,
heroes: ImmutableList<MatrixUser> = persistentListOf(),
isTombstoned: Boolean = false,
) = SelectRoomInfo(
roomId = roomId,
name = name,
canonicalAlias = canonicalAlias,
avatarUrl = avatarUrl,
heroes = heroes,
isTombstoned = isTombstoned,
)

View file

@ -21,6 +21,7 @@ data class SelectRoomInfo(
val canonicalAlias: RoomAlias?,
val avatarUrl: String?,
val heroes: ImmutableList<MatrixUser>,
val isTombstoned: Boolean,
) {
fun getAvatarData(size: AvatarSize) = AvatarData(
id = roomId.value,
@ -36,4 +37,5 @@ fun RoomSummary.toSelectRoomInfo() = SelectRoomInfo(
avatarUrl = info.avatarUrl,
heroes = info.heroes,
canonicalAlias = info.canonicalAlias,
isTombstoned = info.successorRoom != null,
)