From 304b281d80205133d2f4fd56ffc5c16b02779b5f Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 10 Nov 2022 09:13:31 +0600 Subject: [PATCH] Update ChatIdentifierWithThreadId.kt --- .../utils/extensions/ChatIdentifierWithThreadId.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/ChatIdentifierWithThreadId.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/ChatIdentifierWithThreadId.kt index e571a47bd5..141bb6b5d8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/ChatIdentifierWithThreadId.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/extensions/ChatIdentifierWithThreadId.kt @@ -1,23 +1,23 @@ package dev.inmo.tgbotapi.utils.extensions sealed interface ChatIdWithThreadId { - val chatId: ChatId + val chatId: ChatIdentifier val threadId: MessageThreadId? // Light weight due to absence of any conversations value class ByMessage( val sourceMessage: Message ) : ChatIdWithThreadId { - override val chatId: ChatId + override val chatId: ChatIdentifier get() = sourceMessage.chat.id override val threadId: MessageThreadId? get() = sourceMessage.threadIdOrNull } @Serializable value class ByPair( - val pair: Pair + val pair: Pair ) : ChatIdWithThreadId { - override val chatId: ChatId + override val chatId: ChatIdentifier get() = pair.first override val threadId: MessageThreadId? get() = pair.second @@ -26,7 +26,7 @@ sealed interface ChatIdWithThreadId { companion { inline operator fun invoke(message: Message) = ByMessage(message) inline fun serializable(message: Message) = ByPair(message.chatId.id to message.threadIdOrNull) - inline fun serializable(pair: Pair) = ByPair(pair) + inline fun serializable(pair: Pair) = ByPair(pair) } }