Message queuing : exposes enableSendingQueue method
This commit is contained in:
@@ -105,4 +105,14 @@ interface MatrixClient : Closeable {
|
||||
suspend fun getRecentlyVisitedRooms(): Result<List<RoomId>>
|
||||
suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<ResolvedRoomAlias>
|
||||
suspend fun getRoomPreviewFromRoomId(roomId: RoomId, serverNames: List<String>): Result<RoomPreview>
|
||||
|
||||
/**
|
||||
* Enables or disables the sending queue, according to the given parameter.
|
||||
*
|
||||
* The sending queue automatically disables itself whenever sending an
|
||||
* event with it failed (e.g., sending an event via the Timeline,
|
||||
* so it's required to manually re-enable it as soon as
|
||||
* connectivity is back on the device.
|
||||
*/
|
||||
suspend fun enableSendingQueue(enable: Boolean)
|
||||
}
|
||||
|
||||
@@ -551,6 +551,10 @@ class RustMatrixClient(
|
||||
}.distinctUntilChanged()
|
||||
}
|
||||
|
||||
override suspend fun enableSendingQueue(enable: Boolean) = withContext(sessionDispatcher){
|
||||
client.enableSendingQueue(enable)
|
||||
}
|
||||
|
||||
private suspend fun File.getCacheSize(
|
||||
includeCryptoDb: Boolean = false,
|
||||
): Long = withContext(sessionDispatcher) {
|
||||
@@ -590,6 +594,9 @@ class RustMatrixClient(
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private val defaultRoomCreationPowerLevels = PowerLevels(
|
||||
|
||||
@@ -48,6 +48,7 @@ import io.element.android.libraries.matrix.test.roomdirectory.FakeRoomDirectoryS
|
||||
import io.element.android.libraries.matrix.test.roomlist.FakeRoomListService
|
||||
import io.element.android.libraries.matrix.test.sync.FakeSyncService
|
||||
import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService
|
||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||
import io.element.android.tests.testutils.simulateLongTask
|
||||
import kotlinx.collections.immutable.ImmutableList
|
||||
import kotlinx.collections.immutable.persistentListOf
|
||||
@@ -298,4 +299,10 @@ class FakeMatrixClient(
|
||||
}
|
||||
|
||||
override fun getRoomInfoFlow(roomId: RoomId) = getRoomInfoFlowLambda(roomId)
|
||||
|
||||
var enableSendingQueueLambda = lambdaRecorder(ensureNeverCalled = true) { enable: Boolean ->
|
||||
// no-op
|
||||
}
|
||||
|
||||
override suspend fun enableSendingQueue(enable: Boolean) = enableSendingQueueLambda(enable)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user