mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-04 23:59:55 +00:00
fix in updates unique calculation and update dependencies
This commit is contained in:
@@ -76,9 +76,12 @@ class DefaultBehaviourContext(
|
||||
(it + upstreamUpdatesFlow).filter {
|
||||
val passed = handledUpdates.add(it.updateId)
|
||||
(passed).also { passed ->
|
||||
handledUpdates.removeAll(
|
||||
handledUpdates.take(handledUpdates.size - broadcastChannelsSize).ifEmpty { return@also }
|
||||
)
|
||||
val needToDropCount = handledUpdates.size - broadcastChannelsSize
|
||||
if (needToDropCount > 0) {
|
||||
handledUpdates.removeAll(
|
||||
handledUpdates.take(needToDropCount).ifEmpty { return@also }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user