mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
media group optimizations
This commit is contained in:
parent
d9e1643823
commit
7d1871d8dc
@ -51,6 +51,8 @@ media for present out)
|
|||||||
|
|
||||||
### 0.12.4 UpdatesPoller optimisations
|
### 0.12.4 UpdatesPoller optimisations
|
||||||
|
|
||||||
|
* Optimized preparing of media group in `UpdatesPoller`
|
||||||
|
|
||||||
## 0.11.0
|
## 0.11.0
|
||||||
|
|
||||||
* Kotlin `1.3.11` -> `1.3.21`
|
* Kotlin `1.3.11` -> `1.3.21`
|
||||||
|
@ -31,7 +31,8 @@ class UpdatesPoller(
|
|||||||
private suspend fun pushMediaGroupUpdate(update: BaseMessageUpdate? = null) {
|
private suspend fun pushMediaGroupUpdate(update: BaseMessageUpdate? = null) {
|
||||||
val inputMediaGroupId = (update ?.data as? MediaGroupMessage) ?.mediaGroupId
|
val inputMediaGroupId = (update ?.data as? MediaGroupMessage) ?.mediaGroupId
|
||||||
if (mediaGroup.isNotEmpty() && inputMediaGroupId ?.equals(mediaGroup.mediaGroupId) != true) {
|
if (mediaGroup.isNotEmpty() && inputMediaGroupId ?.equals(mediaGroup.mediaGroupId) != true) {
|
||||||
listOf(*mediaGroup.toTypedArray()).toMediaGroupUpdate() ?.let {
|
mediaGroup.sortBy { it.updateId }
|
||||||
|
mediaGroup.toMediaGroupUpdate() ?.let {
|
||||||
sendToBlock(it)
|
sendToBlock(it)
|
||||||
} ?: mediaGroup.forEach {
|
} ?: mediaGroup.forEach {
|
||||||
sendToBlock(it)
|
sendToBlock(it)
|
||||||
|
Loading…
Reference in New Issue
Block a user