mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Message queuing : branches the enable sending queue mechanism.
This commit is contained in:
+1
-1
@@ -114,7 +114,7 @@ interface MatrixClient : Closeable {
|
||||
* so it's required to manually re-enable it as soon as
|
||||
* connectivity is back on the device.
|
||||
*/
|
||||
suspend fun enableSendingQueue(enable: Boolean)
|
||||
suspend fun setSendingQueueEnabled(enabled: Boolean)
|
||||
|
||||
/**
|
||||
* Returns the current status of the sending queue as a [StateFlow].
|
||||
|
||||
+3
-2
@@ -552,8 +552,9 @@ class RustMatrixClient(
|
||||
}.distinctUntilChanged()
|
||||
}
|
||||
|
||||
override suspend fun enableSendingQueue(enable: Boolean) = withContext(sessionDispatcher) {
|
||||
client.enableSendingQueue(enable)
|
||||
override suspend fun setSendingQueueEnabled(enabled: Boolean) = withContext(sessionDispatcher) {
|
||||
Timber.i("setSendingQueueEnabled($enabled)")
|
||||
client.enableSendingQueue(enabled)
|
||||
}
|
||||
|
||||
override fun sendingQueueStatus(): StateFlow<Boolean> = mxCallbackFlow {
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ class FakeMatrixClient(
|
||||
// no-op
|
||||
}
|
||||
|
||||
override suspend fun enableSendingQueue(enable: Boolean) = enableSendingQueueLambda(enable)
|
||||
override suspend fun setSendingQueueEnabled(enable: Boolean) = enableSendingQueueLambda(enable)
|
||||
|
||||
var sendingQueueStatusFlow = MutableStateFlow(true)
|
||||
override fun sendingQueueStatus(): StateFlow<Boolean> = sendingQueueStatusFlow
|
||||
|
||||
Reference in New Issue
Block a user