fix of recaching for live photos

This commit is contained in:
2026-07-02 17:02:44 +06:00
parent a67a6fa772
commit f979c43794

View File

@@ -92,7 +92,7 @@ class DefaultMessageContentCache<K>(
if (savedSimpleContent is MediaContent && !with(mediaFileActualityChecker) { bot.isActual(savedSimpleContent) }) { if (savedSimpleContent is MediaContent && !with(mediaFileActualityChecker) { bot.isActual(savedSimpleContent) }) {
val savedFileContentAllocator = messagesFilesCache.get(k) ?: error("Unexpected absence of $k file for content ($simpleMessageContentCache)") val savedFileContentAllocator = messagesFilesCache.get(k) ?: error("Unexpected absence of $k file for content ($simpleMessageContentCache)")
val newContent = bot.execute( val newContent = bot.execute(
when (savedSimpleContent.asTelegramMedia()) { when (val content = savedSimpleContent.asTelegramMedia()) {
is TelegramMediaAnimation -> SendAnimation( is TelegramMediaAnimation -> SendAnimation(
filesRefreshingChatId, filesRefreshingChatId,
savedFileContentAllocator, savedFileContentAllocator,
@@ -118,9 +118,10 @@ class DefaultMessageContentCache<K>(
savedFileContentAllocator, savedFileContentAllocator,
disableNotification = true disableNotification = true
) )
is TelegramMediaLivePhoto -> SendPhoto( is TelegramMediaLivePhoto -> SendLivePhoto(
filesRefreshingChatId, chatId = filesRefreshingChatId,
savedFileContentAllocator, livePhoto = content.file,
photo = content.photo,
disableNotification = true disableNotification = true
) )
} }