Sending queue : adjust to match the latest rust api

This commit is contained in:
ganfra 2024-06-12 15:15:04 +02:00
parent bdd6a7959a
commit cd18e5a981
10 changed files with 169 additions and 123 deletions

View file

@ -54,8 +54,10 @@ import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.emptyFlow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.TestScope
import java.util.Optional
@ -300,12 +302,12 @@ class FakeMatrixClient(
override fun getRoomInfoFlow(roomId: RoomId) = getRoomInfoFlowLambda(roomId)
var setSendingQueueEnabledLambda = lambdaRecorder(ensureNeverCalled = true) { _: Boolean ->
var setAllSendQueuesEnabledLambda = lambdaRecorder(ensureNeverCalled = true) { _: Boolean ->
// no-op
}
override suspend fun setSendingQueueEnabled(enabled: Boolean) = setSendingQueueEnabledLambda(enabled)
override suspend fun setAllSendQueuesEnabled(enabled: Boolean) = setAllSendQueuesEnabledLambda(enabled)
var sendingQueueStatusFlow = MutableStateFlow(true)
override fun sendingQueueStatus(): StateFlow<Boolean> = sendingQueueStatusFlow
var sendQueueDisabledFlow = emptyFlow<RoomId>()
override fun sendQueueDisabledFlow(): Flow<RoomId> = sendQueueDisabledFlow
}

View file

@ -525,6 +525,9 @@ class FakeMatrixRoom(
return sendCallNotificationIfNeededResult()
}
var setSendQueueEnabledLambda = { _: Boolean -> }
override suspend fun setSendQueueEnabled(enabled: Boolean) = setSendQueueEnabledLambda(enabled)
override fun getWidgetDriver(widgetSettings: MatrixWidgetSettings): Result<MatrixWidgetDriver> = getWidgetDriverResult
fun givenRoomMembersState(state: MatrixRoomMembersState) {