Various fixes

This commit is contained in:
Ilya Laktyushin 2026-03-29 18:49:14 +02:00
parent acc053a628
commit 8d7b84caac
2 changed files with 6 additions and 1 deletions

View file

@ -31,6 +31,9 @@ func applyMediaResourceChanges(from: Media, to: Media, postbox: Postbox, force:
copyOrMoveResourceData(from: fromLargestRepresentation.resource, to: toLargestRepresentation.resource, mediaBox: postbox.mediaBox)
}
}
if let fromVideo = fromImage.video, let toVideo = toImage.video {
applyMediaResourceChanges(from: fromVideo, to: toVideo, postbox: postbox, force: true)
}
} else if let fromFile = from as? TelegramMediaFile, let toFile = to as? TelegramMediaFile {
if !skipPreviews {
if let fromPreview = smallestImageRepresentation(fromFile.previewRepresentations), let toPreview = smallestImageRepresentation(toFile.previewRepresentations) {

View file

@ -122,6 +122,7 @@ public class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
var automaticDownload: InteractiveMediaNodeAutodownloadMode = .none
var automaticPlayback: Bool = false
var contentMode: InteractiveMediaNodeContentMode = .aspectFit
var isLivePhoto = false
if let updatingMedia = item.attributes.updatingMedia, case let .update(mediaReference) = updatingMedia.media {
selectedMedia = mediaReference.media
@ -136,6 +137,7 @@ public class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
if let _ = telegramImage.video {
automaticPlayback = true
isLivePhoto = true
}
} else if let telegramStory = media as? TelegramMediaStory {
selectedMedia = telegramStory
@ -432,7 +434,7 @@ public class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
var wideLayout = true
if case let .mosaic(_, wide) = position {
wideLayout = wide
automaticPlayback = automaticPlayback && wide
automaticPlayback = automaticPlayback && (wide || isLivePhoto)
}
var updatedPosition: ChatMessageBubbleContentPosition = position