From f81a4bf0f8758c3359c226bc068c69e935c786fd Mon Sep 17 00:00:00 2001 From: Marco Romano Date: Thu, 21 Sep 2023 21:48:19 +0200 Subject: [PATCH] Upgrade Rust SDK to v0.1.57 (#1401) - Enables polls in room summaries from https://github.com/vector-im/element-x-android/pull/1387 - Accommodates a few breaking changes --- gradle/libs.versions.toml | 2 +- .../element/android/libraries/matrix/impl/RustMatrixClient.kt | 2 +- .../android/libraries/matrix/impl/room/RustMatrixRoom.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14b0d58e5f..6f648c1773 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -150,7 +150,7 @@ jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" } appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" } molecule-runtime = { module = "app.cash.molecule:molecule-runtime", version.ref = "molecule" } timber = "com.jakewharton.timber:timber:5.0.1" -matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.1.56" +matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.1.57" matrix_richtexteditor = { module = "io.element.android:wysiwyg", version.ref = "wysiwyg" } matrix_richtexteditor_compose = { module = "io.element.android:wysiwyg-compose", version.ref = "wysiwyg" } sqldelight-driver-android = { module = "com.squareup.sqldelight:android-driver", version.ref = "sqldelight" } diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt index 45d2d2213d..8fc71dc99e 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/RustMatrixClient.kt @@ -191,7 +191,7 @@ class RustMatrixClient constructor( private fun pairOfRoom(roomId: RoomId): Pair? { val cachedRoomListItem = innerRoomListService.roomOrNull(roomId.value) - val fullRoom = cachedRoomListItem?.fullRoom() + val fullRoom = cachedRoomListItem?.fullRoomBlocking() return if (cachedRoomListItem == null || fullRoom == null) { Timber.d("No room cached for $roomId") null diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt index 5f9fd2f61c..4a8a3f9bee 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt @@ -371,7 +371,7 @@ class RustMatrixRoom( @OptIn(ExperimentalUnsignedTypes::class) override suspend fun updateAvatar(mimeType: String, data: ByteArray): Result = withContext(roomDispatcher) { runCatching { - innerRoom.uploadAvatar(mimeType, data.toUByteArray().toList()) + innerRoom.uploadAvatar(mimeType, data.toUByteArray().toList(), null) } }