mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Various fixes
This commit is contained in:
parent
acc053a628
commit
8d7b84caac
2 changed files with 6 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue