fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v25.12.17 (#5912)
* 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 <jorgem@element.io>
This commit is contained in:
parent
24e1514fc3
commit
10b85ec1ff
2 changed files with 20 additions and 8 deletions
|
|
@ -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
|
# 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
|
# 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.
|
# 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
|
# Others
|
||||||
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
coil = { module = "io.coil-kt.coil3:coil", version.ref = "coil" }
|
||||||
|
|
|
||||||
|
|
@ -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 io.element.android.libraries.matrix.impl.timeline.item.event.map
|
||||||
import org.matrix.rustcomponents.sdk.Room
|
import org.matrix.rustcomponents.sdk.Room
|
||||||
import org.matrix.rustcomponents.sdk.use
|
import org.matrix.rustcomponents.sdk.use
|
||||||
|
import uniffi.matrix_sdk_ui.LatestEventValueLocalState
|
||||||
import org.matrix.rustcomponents.sdk.LatestEventValue as RustLatestEventValue
|
import org.matrix.rustcomponents.sdk.LatestEventValue as RustLatestEventValue
|
||||||
|
|
||||||
class RoomSummaryFactory(
|
class RoomSummaryFactory(
|
||||||
|
|
@ -27,13 +28,24 @@ class RoomSummaryFactory(
|
||||||
val latestEvent = room.latestEvent().use { event ->
|
val latestEvent = room.latestEvent().use { event ->
|
||||||
when (event) {
|
when (event) {
|
||||||
is RustLatestEventValue.None -> LatestEventValue.None
|
is RustLatestEventValue.None -> LatestEventValue.None
|
||||||
is RustLatestEventValue.Local -> LatestEventValue.Local(
|
is RustLatestEventValue.Local -> when (event.state) {
|
||||||
timestamp = event.timestamp.toLong(),
|
LatestEventValueLocalState.IS_SENDING,
|
||||||
content = contentMapper.map(event.content),
|
LatestEventValueLocalState.CANNOT_BE_SENT -> LatestEventValue.Local(
|
||||||
isSending = event.isSending,
|
timestamp = event.timestamp.toLong(),
|
||||||
senderId = UserId(event.sender),
|
content = contentMapper.map(event.content),
|
||||||
senderProfile = event.profile.map(),
|
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(
|
is RustLatestEventValue.Remote -> LatestEventValue.Remote(
|
||||||
timestamp = event.timestamp.toLong(),
|
timestamp = event.timestamp.toLong(),
|
||||||
content = contentMapper.map(event.content),
|
content = contentMapper.map(event.content),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue