Skip to content

Commit 614f975

Browse files
committed
Update rust sdk to 0.1.34
1 parent 7cefff8 commit 614f975

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

features/invitelist/impl/src/main/kotlin/io/element/android/features/invitelist/impl/InviteListPresenter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class InviteListPresenter @Inject constructor(
139139
private fun CoroutineScope.acceptInvite(roomId: RoomId, acceptedAction: MutableState<Async<RoomId>>) = launch {
140140
suspend {
141141
client.getRoom(roomId)?.use {
142-
it.acceptInvitation().getOrThrow()
142+
it.join().getOrThrow()
143143
notificationDrawerManager.clearMembershipNotificationForRoom(client.sessionId, roomId)
144144
analyticsService.capture(it.toAnalyticsJoinedRoom(JoinedRoom.Trigger.Invite))
145145
}
@@ -150,7 +150,7 @@ class InviteListPresenter @Inject constructor(
150150
private fun CoroutineScope.declineInvite(roomId: RoomId, declinedAction: MutableState<Async<Unit>>) = launch {
151151
suspend {
152152
client.getRoom(roomId)?.use {
153-
it.rejectInvitation().getOrThrow()
153+
it.leave().getOrThrow()
154154
notificationDrawerManager.clearMembershipNotificationForRoom(client.sessionId, roomId)
155155
}
156156
Unit

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jsoup = { module = "org.jsoup:jsoup", version.ref = "jsoup" }
145145
appyx_core = { module = "com.bumble.appyx:core", version.ref = "appyx" }
146146
molecule-runtime = { module = "app.cash.molecule:molecule-runtime", version.ref = "molecule" }
147147
timber = "com.jakewharton.timber:timber:5.0.1"
148-
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.1.32"
148+
matrix_sdk = "org.matrix.rustcomponents:sdk-android:0.1.34"
149149
sqldelight-driver-android = { module = "com.squareup.sqldelight:android-driver", version.ref = "sqldelight" }
150150
sqldelight-driver-jvm = { module = "com.squareup.sqldelight:sqlite-driver", version.ref = "sqldelight" }
151151
sqldelight-coroutines = { module = "com.squareup.sqldelight:coroutines-extensions", version.ref = "sqldelight" }

libraries/matrix/api/src/main/kotlin/io/element/android/libraries/matrix/api/room/MatrixRoom.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ interface MatrixRoom : Closeable {
9595

9696
suspend fun leave(): Result<Unit>
9797

98-
suspend fun acceptInvitation(): Result<Unit>
99-
100-
suspend fun rejectInvitation(): Result<Unit>
98+
suspend fun join(): Result<Unit>
10199

102100
suspend fun inviteUserById(id: UserId): Result<Unit>
103101

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/room/RustMatrixRoom.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import io.element.android.libraries.matrix.impl.timeline.RustMatrixTimeline
4343
import io.element.android.libraries.matrix.impl.timeline.backPaginationStatusFlow
4444
import io.element.android.libraries.matrix.impl.timeline.timelineDiffFlow
4545
import io.element.android.libraries.sessionstorage.api.SessionData
46-
import io.element.android.libraries.sessionstorage.api.SessionStore
4746
import io.element.android.services.toolbox.api.systemclock.SystemClock
4847
import kotlinx.coroutines.CoroutineScope
4948
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -82,6 +81,7 @@ class RustMatrixRoom(
8281

8382
// Create a dispatcher for all room methods...
8483
private val roomDispatcher = coroutineDispatchers.io.limitedParallelism(32)
84+
8585
//...except getMember methods as it could quickly fill the roomDispatcher...
8686
private val roomMembersDispatcher = coroutineDispatchers.io.limitedParallelism(8)
8787

@@ -257,15 +257,9 @@ class RustMatrixRoom(
257257
}
258258
}
259259

260-
override suspend fun acceptInvitation(): Result<Unit> = withContext(roomDispatcher) {
261-
runCatching {
262-
innerRoom.acceptInvitation()
263-
}
264-
}
265-
266-
override suspend fun rejectInvitation(): Result<Unit> = withContext(roomDispatcher) {
260+
override suspend fun join(): Result<Unit> = withContext(roomDispatcher) {
267261
runCatching {
268-
innerRoom.rejectInvitation()
262+
innerRoom.join()
269263
}
270264
}
271265

0 commit comments

Comments
 (0)