Fix formatting issues

This commit is contained in:
ganfra 2024-06-12 15:31:59 +02:00
parent cd18e5a981
commit 05786cedc3
5 changed files with 6 additions and 12 deletions

View file

@ -38,7 +38,6 @@ class SendQueues @Inject constructor(
private val matrixClient: MatrixClient, private val matrixClient: MatrixClient,
private val networkMonitor: NetworkMonitor, private val networkMonitor: NetworkMonitor,
) { ) {
fun launchIn(coroutineScope: CoroutineScope) { fun launchIn(coroutineScope: CoroutineScope) {
networkMonitor.connectivity networkMonitor.connectivity
.onEach { networkStatus -> .onEach { networkStatus ->
@ -55,6 +54,7 @@ class SendQueues @Inject constructor(
room.setSendQueueEnabled(enabled = true) room.setSendQueueEnabled(enabled = true)
} }
} }
}.launchIn(coroutineScope) }
.launchIn(coroutineScope)
} }
} }

View file

@ -39,7 +39,6 @@ import org.junit.Test
@Test @Test
fun `test network status online and sending queue failed`() = runTest { fun `test network status online and sending queue failed`() = runTest {
val sendQueueDisabledFlow = MutableSharedFlow<RoomId>(replay = 1) val sendQueueDisabledFlow = MutableSharedFlow<RoomId>(replay = 1)
val setAllSendQueuesEnabledLambda = lambdaRecorder { _: Boolean -> } val setAllSendQueuesEnabledLambda = lambdaRecorder { _: Boolean -> }
matrixClient.sendQueueDisabledFlow = sendQueueDisabledFlow matrixClient.sendQueueDisabledFlow = sendQueueDisabledFlow
@ -62,12 +61,10 @@ import org.junit.Test
assert(setRoomSendQueueEnabledLambda) assert(setRoomSendQueueEnabledLambda)
.isCalledOnce() .isCalledOnce()
.with(value(true)) .with(value(true))
} }
@Test @Test
fun `test network status offline and sending queue failed`() = runTest { fun `test network status offline and sending queue failed`() = runTest {
val sendQueueDisabledFlow = MutableSharedFlow<RoomId>(replay = 1) val sendQueueDisabledFlow = MutableSharedFlow<RoomId>(replay = 1)
val setAllSendQueuesEnabledLambda = lambdaRecorder { _: Boolean -> } val setAllSendQueuesEnabledLambda = lambdaRecorder { _: Boolean -> }
@ -91,12 +88,10 @@ import org.junit.Test
assert(setRoomSendQueueEnabledLambda) assert(setRoomSendQueueEnabledLambda)
.isNeverCalled() .isNeverCalled()
} }
@Test @Test
fun `test network status getting offline and online`() = runTest { fun `test network status getting offline and online`() = runTest {
val setEnableSendingQueueLambda = lambdaRecorder { _: Boolean -> } val setEnableSendingQueueLambda = lambdaRecorder { _: Boolean -> }
matrixClient.setAllSendQueuesEnabledLambda = setEnableSendingQueueLambda matrixClient.setAllSendQueuesEnabledLambda = setEnableSendingQueueLambda

View file

@ -21,7 +21,7 @@ import org.matrix.rustcomponents.sdk.OidcConfiguration
import java.io.File import java.io.File
import javax.inject.Inject import javax.inject.Inject
class OidConfigurationProvider @Inject constructor( class OidcConfigurationProvider @Inject constructor(
private val baseDirectory: File, private val baseDirectory: File,
) { ) {
fun get(): OidcConfiguration = OidcConfiguration( fun get(): OidcConfiguration = OidcConfiguration(

View file

@ -69,7 +69,7 @@ class RustMatrixAuthenticationService @Inject constructor(
private val passphraseGenerator: PassphraseGenerator, private val passphraseGenerator: PassphraseGenerator,
userCertificatesProvider: UserCertificatesProvider, userCertificatesProvider: UserCertificatesProvider,
proxyProvider: ProxyProvider, proxyProvider: ProxyProvider,
private val oidConfigurationProvider: OidConfigurationProvider, private val oidcConfigurationProvider: OidcConfigurationProvider,
) : MatrixAuthenticationService { ) : MatrixAuthenticationService {
// Passphrase which will be used for new sessions. Existing sessions will use the passphrase // Passphrase which will be used for new sessions. Existing sessions will use the passphrase
// stored in the SessionData. // stored in the SessionData.
@ -81,7 +81,7 @@ class RustMatrixAuthenticationService @Inject constructor(
proxy = proxyProvider.provides(), proxy = proxyProvider.provides(),
userAgent = userAgentProvider.provide(), userAgent = userAgentProvider.provide(),
additionalRootCertificates = userCertificatesProvider.provides(), additionalRootCertificates = userCertificatesProvider.provides(),
oidcConfiguration = oidConfigurationProvider.get(), oidcConfiguration = oidcConfigurationProvider.get(),
customSlidingSyncProxy = null, customSlidingSyncProxy = null,
sessionDelegate = null, sessionDelegate = null,
crossProcessRefreshLockId = null, crossProcessRefreshLockId = null,
@ -220,7 +220,7 @@ class RustMatrixAuthenticationService @Inject constructor(
.passphrase(pendingPassphrase) .passphrase(pendingPassphrase)
.buildWithQrCode( .buildWithQrCode(
qrCodeData = (qrCodeData as SdkQrCodeLoginData).rustQrCodeData, qrCodeData = (qrCodeData as SdkQrCodeLoginData).rustQrCodeData,
oidcConfiguration = oidConfigurationProvider.get(), oidcConfiguration = oidcConfigurationProvider.get(),
progressListener = object : QrLoginProgressListener { progressListener = object : QrLoginProgressListener {
override fun onUpdate(state: QrLoginProgress) { override fun onUpdate(state: QrLoginProgress) {
Timber.d("QR Code login progress: $state") Timber.d("QR Code login progress: $state")

View file

@ -281,7 +281,6 @@ class RustTimeline(
messageEventContentFromParts(body, htmlBody).withMentions(mentions.map()).use { content -> messageEventContentFromParts(body, htmlBody).withMentions(mentions.map()).use { content ->
runCatching<Unit> { runCatching<Unit> {
inner.send(content) inner.send(content)
Unit
} }
} }
} }