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 14121516d6..0200f495ef 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 @@ -91,7 +91,7 @@ class RoomListRoomSummaryFactory( } is LatestEventValue.Remote -> { val content = roomLatestEventFormatter.format(latestEvent, dm).orEmpty() - LatestEvent.Regular( + LatestEvent.Synced( content = content, ) } diff --git a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/LatestEvent.kt b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/LatestEvent.kt index 6a268e8284..d6ddcf258c 100644 --- a/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/LatestEvent.kt +++ b/features/home/impl/src/main/kotlin/io/element/android/features/home/impl/model/LatestEvent.kt @@ -13,7 +13,7 @@ import androidx.compose.runtime.Immutable sealed interface LatestEvent { data object None : LatestEvent - data class Regular( + data class Synced( val content: CharSequence?, ) : LatestEvent @@ -26,7 +26,7 @@ sealed interface LatestEvent { fun content(): CharSequence? { return when (this) { is None -> null - is Regular -> content + is Synced -> content is Sending -> content is Error -> null } 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 65c70f98ed..400decff6f 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 @@ -28,7 +28,7 @@ open class RoomListRoomSummaryProvider : PreviewParameterProvider { name = "Room", numberOfUnreadMessages = 1, timestamp = "14:18", - latestEvent = LatestEvent.Regular("A very very very very long message which suites on two lines"), + latestEvent = LatestEvent.Synced("A very very very very long message which suites on two lines"), avatarData = AvatarData("!id", "R", size = AvatarSize.RoomListItem), id = "!roomId:domain", ), @@ -97,7 +97,7 @@ internal fun aRoomListRoomSummaryList(): ImmutableList { name = "Room#2", numberOfUnreadMessages = 0, timestamp = "14:16", - latestEvent = LatestEvent.Regular("A short message"), + latestEvent = LatestEvent.Synced("A short message"), avatarData = AvatarData("!id", "Z", size = AvatarSize.RoomListItem), id = "!roomId2:domain", ), @@ -120,7 +120,7 @@ internal fun generateRoomListRoomSummaryList( name = "Room#$index", numberOfUnreadMessages = 0, timestamp = "14:16", - latestEvent = LatestEvent.Regular("A message"), + latestEvent = LatestEvent.Synced("A message"), avatarData = AvatarData("!id$index", "${(65 + index % 26).toChar()}", size = AvatarSize.RoomListItem), id = "!roomId$index:domain", ) 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 0a5350d086..28e7051a55 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 @@ -96,7 +96,7 @@ internal fun createRoomListRoomSummary( numberOfUnreadNotifications = numberOfUnreadNotifications, isMarkedUnread = isMarkedUnread, timestamp = timestamp, - latestEvent = LatestEvent.Regular(""), + latestEvent = LatestEvent.Synced(""), avatarData = AvatarData(id = A_ROOM_ID.value, name = A_ROOM_NAME, size = AvatarSize.RoomListItem), displayType = displayType, userDefinedNotificationMode = userDefinedNotificationMode,