mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-23 08:10:15 +01:00
reusing the suspend scope
This commit is contained in:
parent
fedbe048ba
commit
410a7b525f
@ -198,7 +198,7 @@ class VectorMessagingReceiver : MessagingReceiver() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getEventFastLane(session: Session, pushData: PushData) {
|
private suspend fun getEventFastLane(session: Session, pushData: PushData) {
|
||||||
pushData.roomId ?: return
|
pushData.roomId ?: return
|
||||||
pushData.eventId ?: return
|
pushData.eventId ?: return
|
||||||
|
|
||||||
@ -212,18 +212,16 @@ class VectorMessagingReceiver : MessagingReceiver() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
coroutineScope.launch {
|
Timber.tag(loggerTag.value).d("Fast lane: start request")
|
||||||
Timber.tag(loggerTag.value).d("Fast lane: start request")
|
val event = tryOrNull { session.eventService().getEvent(pushData.roomId, pushData.eventId) } ?: return
|
||||||
val event = tryOrNull { session.eventService().getEvent(pushData.roomId, pushData.eventId) } ?: return@launch
|
|
||||||
|
|
||||||
val resolvedEvent = notifiableEventResolver.resolveInMemoryEvent(session, event, canBeReplaced = true)
|
val resolvedEvent = notifiableEventResolver.resolveInMemoryEvent(session, event, canBeReplaced = true)
|
||||||
|
|
||||||
resolvedEvent
|
resolvedEvent
|
||||||
?.also { Timber.tag(loggerTag.value).d("Fast lane: notify drawer") }
|
?.also { Timber.tag(loggerTag.value).d("Fast lane: notify drawer") }
|
||||||
?.let {
|
?.let {
|
||||||
notificationDrawerManager.updateEvents { it.onNotifiableEventReceived(resolvedEvent) }
|
notificationDrawerManager.updateEvents { it.onNotifiableEventReceived(resolvedEvent) }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the event was not yet received
|
// check if the event was not yet received
|
||||||
|
Loading…
Reference in New Issue
Block a user