unused flow

This commit is contained in:
valere 2023-04-07 14:09:25 +02:00
parent 1b12db9270
commit 4ecbf87cda

View File

@ -28,6 +28,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.cancellable
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
@ -76,9 +77,8 @@ class KeyRequestHandler @Inject constructor(
// lateinit var listenerJob: Job
fun start(session: Session) {
this.session = session
scope = CoroutineScope(SupervisorJob() + session.coroutineScope.coroutineContext)
// session.cryptoService().verificationService().addListener(this)
scope!!.launch {
val scope = CoroutineScope(SupervisorJob() + session.coroutineScope.coroutineContext)
this.scope = scope
session.cryptoService().verificationService().requestEventFlow()
.cancellable()
.onEach {
@ -88,8 +88,7 @@ class KeyRequestHandler @Inject constructor(
is VerificationEvent.TransactionAdded -> transactionCreated(it.transaction)
is VerificationEvent.TransactionUpdated -> transactionUpdated(it.transaction)
}
}
}
}.launchIn(scope)
session.cryptoService().addRoomKeysRequestListener(this)
}