mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-04 10:32:34 +00:00
Message queuing : exposes enableSendingQueue method
This commit is contained in:
+10
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -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(
|
||||||
|
|||||||
+7
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user