From 74ca4ff9d614c85ceb33a0175008284d5fad3177 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:08:41 +0000 Subject: [PATCH] fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.12.17 (#5912) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.12.17 * Fix changes in the SDK: `LatestEventValue.Local` doesn't have an `isSending` property anymore, now it has `state: LatestEventValueLocalState`. If this is `HAS_BEEN_SENT`, it's equivalent to a `LatestEventValue.Remote`, we just haven't received the updated value from the SDK yet. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín --- gradle/libs.versions.toml | 2 +- .../impl/roomlist/RoomSummaryFactory.kt | 26 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 55a24ebe33..71c25351ae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -177,7 +177,7 @@ test_detekt_test = { module = "io.gitlab.arturbosch.detekt:detekt-test", version # https://github.com/matrix-org/matrix-rust-components-kotlin/commits/main/sdk/sdk-android/src/main/kotlin/org/matrix/rustcomponents/sdk/matrix_sdk_ffi.kt # All new features should not be implemented in the pull request that upgrades the version, developers should # only fix API breaks and may add some TODOs. -matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.12.10" +matrix_sdk = "org.matrix.rustcomponents:sdk-android:25.12.17" # Others coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" } diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist/RoomSummaryFactory.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist/RoomSummaryFactory.kt index 4872dc48e8..738c1f72ea 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist/RoomSummaryFactory.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/roomlist/RoomSummaryFactory.kt @@ -16,6 +16,7 @@ import io.element.android.libraries.matrix.impl.timeline.item.event.TimelineEven import io.element.android.libraries.matrix.impl.timeline.item.event.map import org.matrix.rustcomponents.sdk.Room import org.matrix.rustcomponents.sdk.use +import uniffi.matrix_sdk_ui.LatestEventValueLocalState import org.matrix.rustcomponents.sdk.LatestEventValue as RustLatestEventValue class RoomSummaryFactory( @@ -27,13 +28,24 @@ class RoomSummaryFactory( val latestEvent = room.latestEvent().use { event -> when (event) { is RustLatestEventValue.None -> LatestEventValue.None - is RustLatestEventValue.Local -> LatestEventValue.Local( - timestamp = event.timestamp.toLong(), - content = contentMapper.map(event.content), - isSending = event.isSending, - senderId = UserId(event.sender), - senderProfile = event.profile.map(), - ) + is RustLatestEventValue.Local -> when (event.state) { + LatestEventValueLocalState.IS_SENDING, + LatestEventValueLocalState.CANNOT_BE_SENT -> LatestEventValue.Local( + timestamp = event.timestamp.toLong(), + content = contentMapper.map(event.content), + isSending = event.state == LatestEventValueLocalState.IS_SENDING, + senderId = UserId(event.sender), + senderProfile = event.profile.map(), + ) + // This is the same as a remote event, we just haven't received the local -> remote update yet + LatestEventValueLocalState.HAS_BEEN_SENT -> LatestEventValue.Remote( + timestamp = event.timestamp.toLong(), + content = contentMapper.map(event.content), + senderId = UserId(event.sender), + senderProfile = event.profile.map(), + isOwn = true, + ) + } is RustLatestEventValue.Remote -> LatestEventValue.Remote( timestamp = event.timestamp.toLong(), content = contentMapper.map(event.content),