1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

Merge pull request #71 from InsanusMokrassar/0.25.1

0.25.1
This commit is contained in:
InsanusMokrassar 2020-03-26 14:36:00 +06:00 committed by GitHub
commit b7ec2f2b86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 10 deletions

View File

@ -25,6 +25,11 @@
* `FlowsUpdatesFilter` now have two additional flows: `pollAnswerFlow`, `unknownUpdateTypeFlow` * `FlowsUpdatesFilter` now have two additional flows: `pollAnswerFlow`, `unknownUpdateTypeFlow`
* `ExtendedUser` (`typealias`) was added as a `PreviewFeature` * `ExtendedUser` (`typealias`) was added as a `PreviewFeature`
### 0.25.1
* Update kotlin: `1.3.70` -> `1.3.71`
* Fix of error inside of update utils for media groups
## 0.24.0 ## 0.24.0
* `TelegramBotAPI`: * `TelegramBotAPI`:

View File

@ -23,19 +23,19 @@ internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
val resultUpdates = mutableListOf<Update>() val resultUpdates = mutableListOf<Update>()
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<BaseSentMessageUpdate>>() val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<BaseSentMessageUpdate>>()
for (update in this) { for (update in this) {
val data = (update.data as? MediaGroupMessage)
if (data == null) {
resultUpdates.add(update)
continue
}
when (update) { when (update) {
is BaseEditMessageUpdate -> resultUpdates.add( is BaseEditMessageUpdate -> resultUpdates.add(
update.toEditMediaGroupUpdate() update.toEditMediaGroupUpdate()
) )
is BaseSentMessageUpdate -> { is BaseSentMessageUpdate -> {
val data = update.data
if (data is MediaGroupMessage) {
mediaGroups.getOrPut(data.mediaGroupId) { mediaGroups.getOrPut(data.mediaGroupId) {
mutableListOf() mutableListOf()
}.add(update) }.add(update)
} else {
resultUpdates.add(update)
}
} }
else -> resultUpdates.add(update) else -> resultUpdates.add(update)
} }

View File

@ -1,5 +1,5 @@
kotlin.code.style=official kotlin.code.style=official
kotlin_version=1.3.70 kotlin_version=1.3.71
kotlin_coroutines_version=1.3.5 kotlin_coroutines_version=1.3.5
kotlin_serialisation_runtime_version=0.20.0 kotlin_serialisation_runtime_version=0.20.0
klock_version=1.10.0 klock_version=1.10.0
@ -7,6 +7,6 @@ uuid_version=0.1.0
ktor_version=1.3.2 ktor_version=1.3.2
library_group=com.github.insanusmokrassar library_group=com.github.insanusmokrassar
library_version=0.25.0 library_version=0.25.1
gradle_bintray_plugin_version=1.8.4 gradle_bintray_plugin_version=1.8.4