Merge pull request #3809 from element-hq/renovate/org.matrix.rustcomponents-sdk-android-0.x
fix(deps): update dependency org.matrix.rustcomponents:sdk-android to v0.2.59
This commit is contained in:
commit
4620bb8704
13 changed files with 56 additions and 25 deletions
|
|
@ -73,7 +73,6 @@ import kotlinx.collections.immutable.ImmutableList
|
|||
import kotlinx.collections.immutable.persistentListOf
|
||||
import kotlinx.collections.immutable.toPersistentList
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.TimeoutCancellationException
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
|
|
@ -115,7 +114,6 @@ import org.matrix.rustcomponents.sdk.RoomPreset as RustRoomPreset
|
|||
import org.matrix.rustcomponents.sdk.RoomVisibility as RustRoomVisibility
|
||||
import org.matrix.rustcomponents.sdk.SyncService as ClientSyncService
|
||||
|
||||
@OptIn(ExperimentalCoroutinesApi::class)
|
||||
class RustMatrixClient(
|
||||
private val client: Client,
|
||||
private val baseDirectory: File,
|
||||
|
|
@ -442,13 +440,15 @@ class RustMatrixClient(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<ResolvedRoomAlias> = withContext(sessionDispatcher) {
|
||||
override suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<Optional<ResolvedRoomAlias>> = withContext(sessionDispatcher) {
|
||||
runCatching {
|
||||
val result = client.resolveRoomAlias(roomAlias.value)
|
||||
ResolvedRoomAlias(
|
||||
roomId = RoomId(result.roomId),
|
||||
servers = result.servers,
|
||||
)
|
||||
val result = client.resolveRoomAlias(roomAlias.value)?.let {
|
||||
ResolvedRoomAlias(
|
||||
roomId = RoomId(it.roomId),
|
||||
servers = it.servers,
|
||||
)
|
||||
}
|
||||
Optional.ofNullable(result)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ class RustRoomDirectoryList(
|
|||
.launchIn(coroutineScope)
|
||||
}
|
||||
|
||||
override suspend fun filter(filter: String?, batchSize: Int): Result<Unit> {
|
||||
override suspend fun filter(filter: String?, batchSize: Int, viaServerName: String?): Result<Unit> {
|
||||
return execute {
|
||||
inner.search(filter = filter, batchSize = batchSize.toUInt())
|
||||
inner.search(filter = filter, batchSize = batchSize.toUInt(), viaServerName = viaServerName)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class FakeRustRoomDirectorySearch(
|
|||
return isAtLastPage
|
||||
}
|
||||
|
||||
override suspend fun search(filter: String?, batchSize: UInt) = simulateLongTask { }
|
||||
override suspend fun search(filter: String?, batchSize: UInt, viaServerName: String?) = simulateLongTask { }
|
||||
override suspend fun nextPage() = simulateLongTask { }
|
||||
|
||||
private var listener: RoomDirectorySearchEntriesListener? = null
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class RustRoomDirectoryListTest {
|
|||
// Let the mxCallback be ready
|
||||
runCurrent()
|
||||
sut.state.test {
|
||||
sut.filter("", 20)
|
||||
sut.filter(filter = "", batchSize = 20, viaServerName = null)
|
||||
roomDirectorySearch.emitResult(
|
||||
listOf(
|
||||
RoomDirectorySearchEntryUpdate.Append(listOf(aRustRoomDescription()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue