Message queuing : exposes enableSendingQueue method
This commit is contained in:
parent
102cd5769e
commit
ba4abe3de7
3 changed files with 24 additions and 0 deletions
|
|
@ -105,4 +105,14 @@ interface MatrixClient : Closeable {
|
||||||
suspend fun getRecentlyVisitedRooms(): Result<List<RoomId>>
|
suspend fun getRecentlyVisitedRooms(): Result<List<RoomId>>
|
||||||
suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<ResolvedRoomAlias>
|
suspend fun resolveRoomAlias(roomAlias: RoomAlias): Result<ResolvedRoomAlias>
|
||||||
suspend fun getRoomPreviewFromRoomId(roomId: RoomId, serverNames: List<String>): Result<RoomPreview>
|
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()
|
}.distinctUntilChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override suspend fun enableSendingQueue(enable: Boolean) = withContext(sessionDispatcher){
|
||||||
|
client.enableSendingQueue(enable)
|
||||||
|
}
|
||||||
|
|
||||||
private suspend fun File.getCacheSize(
|
private suspend fun File.getCacheSize(
|
||||||
includeCryptoDb: Boolean = false,
|
includeCryptoDb: Boolean = false,
|
||||||
): Long = withContext(sessionDispatcher) {
|
): Long = withContext(sessionDispatcher) {
|
||||||
|
|
@ -590,6 +594,9 @@ class RustMatrixClient(
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private val defaultRoomCreationPowerLevels = PowerLevels(
|
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.roomlist.FakeRoomListService
|
||||||
import io.element.android.libraries.matrix.test.sync.FakeSyncService
|
import io.element.android.libraries.matrix.test.sync.FakeSyncService
|
||||||
import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService
|
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 io.element.android.tests.testutils.simulateLongTask
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
import kotlinx.collections.immutable.persistentListOf
|
import kotlinx.collections.immutable.persistentListOf
|
||||||
|
|
@ -298,4 +299,10 @@ class FakeMatrixClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getRoomInfoFlow(roomId: RoomId) = getRoomInfoFlowLambda(roomId)
|
override fun getRoomInfoFlow(roomId: RoomId) = getRoomInfoFlowLambda(roomId)
|
||||||
|
|
||||||
|
var enableSendingQueueLambda = lambdaRecorder(ensureNeverCalled = true) { enable: Boolean ->
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
override suspend fun enableSendingQueue(enable: Boolean) = enableSendingQueueLambda(enable)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue