From ff8d67a780e3b85b89862cb006853e447a3f0c05 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Apr 2023 19:26:58 +0600 Subject: [PATCH] potential fix in native --- .../bot/ktor/base/MultipartRequestCallFactory.kt | 3 +-- .../dev/inmo/tgbotapi/requests/chat/get/GetChat.kt | 2 +- .../inmo/tgbotapi/types/chat/ExtendedAbstracts.kt | 14 +++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt index 0fdcd1c5af..b01f66e2dd 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt @@ -4,8 +4,7 @@ import dev.inmo.tgbotapi.requests.abstracts.* import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper import dev.inmo.tgbotapi.utils.mapWithCommonValues import io.ktor.client.HttpClient -import io.ktor.client.request.forms.MultiPartFormDataContent -import io.ktor.client.request.forms.formData +import io.ktor.client.request.forms.* import io.ktor.http.Headers import io.ktor.http.HttpHeaders diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChat.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChat.kt index 913c083500..7e929880c9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChat.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/get/GetChat.kt @@ -19,7 +19,7 @@ data class GetChat( override val resultDeserializer: DeserializationStrategy = if (chatId is ChatIdWithThreadId) { ExtendedChatSerializer.BasedOnForumThread(chatId.threadId) } else { - ExtendedChatSerializer + ExtendedChatSerializer.Companion } override val requestSerializer: SerializationStrategy<*> get() = serializer() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt index 734b8bacc3..9d2bc0bcbe 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/chat/ExtendedAbstracts.kt @@ -5,17 +5,17 @@ import dev.inmo.tgbotapi.types.message.abstracts.Message import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer import kotlinx.serialization.Serializable -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedChannelChat : ChannelChat, ExtendedPublicChat, ExtendedChatWithUsername { val linkedGroupChatId: IdChatIdentifier? } -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedGroupChat : GroupChat, ExtendedPublicChat { val permissions: ChatPermissions } -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername { val bio: String val hasPrivateForwards: Boolean @@ -34,7 +34,7 @@ sealed interface ExtendedPublicChat : ExtendedChat, PublicChat { val membersHidden: Boolean } -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, ExtendedChatWithUsername { val slowModeDelay: Long? val stickerSetName: StickerSetName? @@ -58,15 +58,15 @@ sealed interface ExtendedSupergroupChat : SupergroupChat, ExtendedGroupChat, Ext val isAggressiveAntiSpamEnabled: Boolean } -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedForumChat : ExtendedSupergroupChat, ForumChat -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedChat : Chat { val chatPhoto: ChatPhoto? } -@Serializable(ExtendedChatSerializer::class) +@Serializable(ExtendedChatSerializer.Companion::class) sealed interface ExtendedChatWithUsername : UsernameChat, ExtendedChat { val activeUsernames: List }