From c8fe12cb8ede9342429ff74b60ccdcca55b99099 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Thu, 20 Mar 2025 21:53:52 +0400 Subject: [PATCH 1/5] Various fixes --- .../Sources/InteractiveTextComponent.swift | 7 +- .../Sources/DrawingMessageRenderer.swift | 3 + .../Sources/Chat/ChatControllerPaste.swift | 116 ++++++++++-------- .../TelegramUI/Sources/ChatController.swift | 9 +- .../Sources/ChatInterfaceInputContexts.swift | 34 ++--- 5 files changed, 97 insertions(+), 72 deletions(-) diff --git a/submodules/TelegramUI/Components/InteractiveTextComponent/Sources/InteractiveTextComponent.swift b/submodules/TelegramUI/Components/InteractiveTextComponent/Sources/InteractiveTextComponent.swift index 4a521443bf..db6bb21216 100644 --- a/submodules/TelegramUI/Components/InteractiveTextComponent/Sources/InteractiveTextComponent.swift +++ b/submodules/TelegramUI/Components/InteractiveTextComponent/Sources/InteractiveTextComponent.swift @@ -1158,7 +1158,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn public func textRangeRects(in range: NSRange) -> (rects: [CGRect], start: TextRangeRectEdge, end: TextRangeRectEdge)? { return self.cachedLayout?.rangeRects(in: range) } - + override public init() { super.init() @@ -1946,7 +1946,7 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn } } else { contentItemAnimation = .None - contentItemLayer = TextContentItemLayer() + contentItemLayer = TextContentItemLayer(displaysAsynchronously: self.displaysAsynchronously) self.contentItemLayers[contentItem.id] = contentItemLayer self.layer.addSublayer(contentItemLayer) } @@ -2461,8 +2461,9 @@ final class TextContentItemLayer: SimpleLayer { private var isAnimating: Bool = false private var currentContentMask: RenderMask? - override init() { + init(displaysAsynchronously: Bool) { self.renderNode = RenderNode() + self.renderNode.displaysAsynchronously = displaysAsynchronously super.init() diff --git a/submodules/TelegramUI/Components/MediaEditor/Sources/DrawingMessageRenderer.swift b/submodules/TelegramUI/Components/MediaEditor/Sources/DrawingMessageRenderer.swift index 05f3c0c9dc..acf33642b9 100644 --- a/submodules/TelegramUI/Components/MediaEditor/Sources/DrawingMessageRenderer.swift +++ b/submodules/TelegramUI/Components/MediaEditor/Sources/DrawingMessageRenderer.swift @@ -112,11 +112,14 @@ public final class DrawingMessageRenderer { self.wallpaperColor = wallpaperColor self.messagesContainerNode = ASDisplayNode() + self.messagesContainerNode.displaysAsynchronously = false self.messagesContainerNode.clipsToBounds = true self.messagesContainerNode.transform = CATransform3DMakeScale(1.0, -1.0, 1.0) super.init() + self.displaysAsynchronously = false + self.addSubnode(self.messagesContainerNode) } diff --git a/submodules/TelegramUI/Sources/Chat/ChatControllerPaste.swift b/submodules/TelegramUI/Sources/Chat/ChatControllerPaste.swift index faded6689d..ca9c30f2cd 100644 --- a/submodules/TelegramUI/Sources/Chat/ChatControllerPaste.swift +++ b/submodules/TelegramUI/Sources/Chat/ChatControllerPaste.swift @@ -50,17 +50,22 @@ extension ChatControllerImpl { func enqueueGifData(_ data: Data) { self.enqueueMediaMessageDisposable.set((legacyEnqueueGifMessage(account: self.context.account, data: data) |> deliverOnMainQueue).startStrict(next: { [weak self] message in if let strongSelf = self { - let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject - strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ - if let strongSelf = self { - strongSelf.chatDisplayNode.collapseInput() - - strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { - $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } - }) + strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in + guard let strongSelf = self else { + return } - }, nil) - strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject + strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ + if let strongSelf = self { + strongSelf.chatDisplayNode.collapseInput() + + strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { + $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } + }) + } + }, nil) + strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + }) } })) } @@ -68,17 +73,22 @@ extension ChatControllerImpl { func enqueueVideoData(_ data: Data) { self.enqueueMediaMessageDisposable.set((legacyEnqueueGifMessage(account: self.context.account, data: data) |> deliverOnMainQueue).startStrict(next: { [weak self] message in if let strongSelf = self { - let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject - strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ - if let strongSelf = self { - strongSelf.chatDisplayNode.collapseInput() - - strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { - $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } - }) + strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in + guard let strongSelf = self else { + return } - }, nil) - strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject + strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ + if let strongSelf = self { + strongSelf.chatDisplayNode.collapseInput() + + strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { + $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } + }) + } + }, nil) + strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + }) } })) } @@ -98,17 +108,22 @@ extension ChatControllerImpl { let media = TelegramMediaFile(fileId: MediaId(namespace: Namespaces.Media.LocalFile, id: Int64.random(in: Int64.min ... Int64.max)), partialReference: nil, resource: resource, previewRepresentations: [], videoThumbnails: [], immediateThumbnailData: nil, mimeType: "image/webp", size: Int64(data.count), attributes: fileAttributes, alternativeRepresentations: []) let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: media), threadId: strongSelf.chatLocation.threadId, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []) - let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject - strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ - if let strongSelf = self { - strongSelf.chatDisplayNode.collapseInput() - - strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { - $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } - }) + strongSelf.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in + guard let strongSelf = self else { + return } - }, nil) - strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + let replyMessageSubject = strongSelf.presentationInterfaceState.interfaceState.replyMessageSubject + strongSelf.chatDisplayNode.setupSendActionOnViewUpdate({ + if let strongSelf = self { + strongSelf.chatDisplayNode.collapseInput() + + strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { + $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } + }) + } + }, nil) + strongSelf.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }, postpone: postpone) + }) } })) } @@ -116,23 +131,28 @@ extension ChatControllerImpl { func enqueueStickerFile(_ file: TelegramMediaFile) { let message = EnqueueMessage.message(text: "", attributes: [], inlineStickers: [:], mediaReference: .standalone(media: file), threadId: self.chatLocation.threadId, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: []) - let replyMessageSubject = self.presentationInterfaceState.interfaceState.replyMessageSubject - self.chatDisplayNode.setupSendActionOnViewUpdate({ [weak self] in - if let strongSelf = self { - strongSelf.chatDisplayNode.collapseInput() - - strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { - $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } - }) + self.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in + guard let self else { + return } - }, nil) - self.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) - - Queue.mainQueue().after(3.0) { - if let message = self.chatDisplayNode.historyNode.lastVisbleMesssage(), let file = message.media.first(where: { $0 is TelegramMediaFile }) as? TelegramMediaFile, file.isSticker { - self.context.engine.stickers.addRecentlyUsedSticker(fileReference: .message(message: MessageReference(message), media: file)) + let replyMessageSubject = self.presentationInterfaceState.interfaceState.replyMessageSubject + self.chatDisplayNode.setupSendActionOnViewUpdate({ [weak self] in + if let strongSelf = self { + strongSelf.chatDisplayNode.collapseInput() + + strongSelf.updateChatPresentationInterfaceState(animated: true, interactive: false, { + $0.updatedInterfaceState { $0.withUpdatedReplyMessageSubject(nil).withUpdatedSendMessageEffect(nil) } + }) + } + }, nil) + self.sendMessages([message].map { $0.withUpdatedReplyToMessageId(replyMessageSubject?.subjectModel) }) + + Queue.mainQueue().after(3.0) { + if let message = self.chatDisplayNode.historyNode.lastVisbleMesssage(), let file = message.media.first(where: { $0 is TelegramMediaFile }) as? TelegramMediaFile, file.isSticker { + self.context.engine.stickers.addRecentlyUsedSticker(fileReference: .message(message: MessageReference(message), media: file)) + } } - } + }) } func enqueueAnimatedStickerData(_ data: Data) { @@ -223,9 +243,7 @@ extension ChatControllerImpl { fileAttributes.append(.Video(duration: animatedImage.duration, size: PixelDimensions(width: 512, height: 512), flags: [], preloadSize: nil, coverTime: nil, videoCodec: nil)) let previewRepresentations: [TelegramMediaImageRepresentation] = [] -// if let thumbnailResource { -// previewRepresentations.append(TelegramMediaImageRepresentation(dimensions: dimensions, resource: thumbnailResource, progressiveSizes: [], immediateThumbnailData: nil)) -// } + let resource = LocalFileMediaResource(fileId: Int64.random(in: Int64.min ... Int64.max)) self.context.account.postbox.mediaBox.copyResourceData(resource.id, fromTempPath: path) @@ -235,7 +253,5 @@ extension ChatControllerImpl { break } }) - -// self.stickerVideoExport = videoExport } } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index c3e915a55e..6a3a6a79d8 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -9253,8 +9253,13 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } if let value = value { self.present(UndoOverlayController(presentationData: self.presentationData, content: .dice(dice: dice, context: self.context, text: value, action: canSendMessagesToChat(self.presentationInterfaceState) ? self.presentationData.strings.Conversation_SendDice : nil), elevatedLayout: false, action: { [weak self] action in - if let strongSelf = self, canSendMessagesToChat(strongSelf.presentationInterfaceState), action == .undo { - strongSelf.sendMessages([.message(text: "", attributes: [], inlineStickers: [:], mediaReference: AnyMediaReference.standalone(media: TelegramMediaDice(emoji: dice.emoji)), threadId: strongSelf.chatLocation.threadId, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])]) + if let self, canSendMessagesToChat(self.presentationInterfaceState), action == .undo { + self.presentPaidMessageAlertIfNeeded(completion: { [weak self] postpone in + guard let self else { + return + } + self.sendMessages([.message(text: "", attributes: [], inlineStickers: [:], mediaReference: AnyMediaReference.standalone(media: TelegramMediaDice(emoji: dice.emoji)), threadId: self.chatLocation.threadId, replyToMessageId: nil, replyToStoryId: nil, localGroupingKey: nil, correlationId: nil, bubbleUpEmojiOrStickersets: [])], postpone: postpone) + }) } return false }), in: .current) diff --git a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift index ffc3b00db5..34cc89b4ce 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceInputContexts.swift @@ -173,23 +173,7 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte var accessoryItems: [ChatTextInputAccessoryItem] = [] let isTextEmpty = chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 let hasForward = chatPresentationInterfaceState.interfaceState.forwardMessageIds != nil - - if case .scheduledMessages = chatPresentationInterfaceState.subject { - } else { - let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 }) - var showPremiumGift = false - if !premiumConfiguration.isPremiumDisabled { - if chatPresentationInterfaceState.hasBirthdayToday { - showPremiumGift = true - } else if premiumConfiguration.showPremiumGiftInAttachMenu && premiumConfiguration.showPremiumGiftInTextField { - showPremiumGift = true - } - } - if isTextEmpty, showPremiumGift, let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, !peer.isDeleted && peer.botInfo == nil && !peer.flags.contains(.isSupport) && chatPresentationInterfaceState.suggestPremiumGift { - accessoryItems.append(.gift) - } - } - + var extendedSearchLayout = false loop: for (_, result) in chatPresentationInterfaceState.inputQueryResults { if case let .contextRequestResult(peer, _) = result, peer != nil { @@ -207,6 +191,22 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte } } } + + if case .scheduledMessages = chatPresentationInterfaceState.subject { + } else { + let premiumConfiguration = PremiumConfiguration.with(appConfiguration: context.currentAppConfiguration.with { $0 }) + var showPremiumGift = false + if !premiumConfiguration.isPremiumDisabled { + if chatPresentationInterfaceState.hasBirthdayToday { + showPremiumGift = true + } else if premiumConfiguration.showPremiumGiftInAttachMenu && premiumConfiguration.showPremiumGiftInTextField { + showPremiumGift = true + } + } + if isTextEmpty, showPremiumGift, let peer = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, !peer.isDeleted && peer.botInfo == nil && !peer.flags.contains(.isSupport) && chatPresentationInterfaceState.suggestPremiumGift { + accessoryItems.append(.gift) + } + } if isTextEmpty && chatPresentationInterfaceState.hasScheduledMessages && !hasForward { accessoryItems.append(.scheduledMessages) From 7c700f9f801d34712444e976101074624b379bc7 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Wed, 19 Mar 2025 18:55:42 +0100 Subject: [PATCH 2/5] Fix BrowserScreen memory leak (cherry picked from commit 006b14bda7838a7bb53015177347a6d04edea8ae) --- .../BrowserUI/Sources/BrowserScreen.swift | 20 +++++++++---------- .../TelegramUI/Sources/OpenChatMessage.swift | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/submodules/BrowserUI/Sources/BrowserScreen.swift b/submodules/BrowserUI/Sources/BrowserScreen.swift index 0a46ee4a66..2d8f5e864e 100644 --- a/submodules/BrowserUI/Sources/BrowserScreen.swift +++ b/submodules/BrowserUI/Sources/BrowserScreen.swift @@ -582,35 +582,35 @@ public class BrowserScreen: ViewController, MinimizableController { } let shareController = ShareController(context: self.context, subject: subject) shareController.completed = { [weak self] peerIds in - guard let strongSelf = self else { + guard let self else { return } - let _ = (strongSelf.context.engine.data.get( + let _ = (self.context.engine.data.get( EngineDataList( peerIds.map(TelegramEngine.EngineData.Item.Peer.Peer.init) ) ) |> deliverOnMainQueue).startStandalone(next: { [weak self] peerList in - guard let strongSelf = self else { + guard let self else { return } let peers = peerList.compactMap { $0 } - let presentationData = strongSelf.context.sharedContext.currentPresentationData.with { $0 } + let presentationData = self.context.sharedContext.currentPresentationData.with { $0 } let text: String var savedMessages = false - if peerIds.count == 1, let peerId = peerIds.first, peerId == strongSelf.context.account.peerId && !isDocument { + if peerIds.count == 1, let peerId = peerIds.first, peerId == self.context.account.peerId && !isDocument { text = presentationData.strings.WebBrowser_LinkAddedToBookmarks savedMessages = true } else { if peers.count == 1, let peer = peers.first { - let peerName = peer.id == strongSelf.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) + let peerName = peer.id == self.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) text = isDocument ? presentationData.strings.WebBrowser_FileForwardTooltip_Chat_One(peerName).string : presentationData.strings.WebBrowser_LinkForwardTooltip_Chat_One(peerName).string - savedMessages = peer.id == strongSelf.context.account.peerId + savedMessages = peer.id == self.context.account.peerId } else if peers.count == 2, let firstPeer = peers.first, let secondPeer = peers.last { - let firstPeerName = firstPeer.id == strongSelf.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : firstPeer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) - let secondPeerName = secondPeer.id == strongSelf.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : secondPeer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) + let firstPeerName = firstPeer.id == self.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : firstPeer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) + let secondPeerName = secondPeer.id == self.context.account.peerId ? presentationData.strings.DialogList_SavedMessages : secondPeer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) text = isDocument ? presentationData.strings.WebBrowser_FileForwardTooltip_TwoChats_One(firstPeerName, secondPeerName).string : presentationData.strings.WebBrowser_LinkForwardTooltip_TwoChats_One(firstPeerName, secondPeerName).string } else if let peer = peers.first { let peerName = peer.displayTitle(strings: presentationData.strings, displayOrder: presentationData.nameDisplayOrder) @@ -620,7 +620,7 @@ public class BrowserScreen: ViewController, MinimizableController { } } - strongSelf.controller?.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: savedMessages, text: text), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] action in + self.controller?.present(UndoOverlayController(presentationData: presentationData, content: .forward(savedMessages: savedMessages, text: text), elevatedLayout: false, animateInAsReplacement: true, action: { [weak self] action in if savedMessages, let self, action == .info { let _ = (self.context.engine.data.get(TelegramEngine.EngineData.Item.Peer.Peer(id: self.context.account.peerId)) |> deliverOnMainQueue).start(next: { [weak self] peer in diff --git a/submodules/TelegramUI/Sources/OpenChatMessage.swift b/submodules/TelegramUI/Sources/OpenChatMessage.swift index ac593bd233..9973541700 100644 --- a/submodules/TelegramUI/Sources/OpenChatMessage.swift +++ b/submodules/TelegramUI/Sources/OpenChatMessage.swift @@ -255,7 +255,10 @@ func openChatMessageImpl(_ params: OpenChatMessageParams) -> Bool { subject = .document(file: .message(message: MessageReference(params.message), media: file), canShare: canShare) } let controller = BrowserScreen(context: params.context, subject: subject) - controller.openDocument = { file, canShare in + controller.openDocument = { [weak controller] file, canShare in + guard let controller else { + return + } controller.dismiss() presentDocumentPreviewController(rootController: rootController, theme: presentationData.theme, strings: presentationData.strings, postbox: params.context.account.postbox, file: file, canShare: canShare) From fb68e14a246f3fe905f7215fef1737bf916fd1bb Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 20 Mar 2025 20:02:25 +0100 Subject: [PATCH 3/5] Update webrtc and tgcalls --- submodules/TgVoipWebrtc/tgcalls | 2 +- third-party/webrtc/webrtc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/TgVoipWebrtc/tgcalls b/submodules/TgVoipWebrtc/tgcalls index bc8334224d..be2870ed32 160000 --- a/submodules/TgVoipWebrtc/tgcalls +++ b/submodules/TgVoipWebrtc/tgcalls @@ -1 +1 @@ -Subproject commit bc8334224dbefb4591d669f7569d16f69134c5b6 +Subproject commit be2870ed32280b62fdd18072735dd2a6a9e85526 diff --git a/third-party/webrtc/webrtc b/third-party/webrtc/webrtc index e8d2ef8c74..dfd6b604d7 160000 --- a/third-party/webrtc/webrtc +++ b/third-party/webrtc/webrtc @@ -1 +1 @@ -Subproject commit e8d2ef8c74f07c4f952db43bdfc08f39228f79c3 +Subproject commit dfd6b604d7194a3d41614afa2c8abd8825a657aa From 2e0597ffe03b4492425956d3619f4462ea3556f5 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Thu, 20 Mar 2025 20:18:16 +0100 Subject: [PATCH 4/5] Bump version --- versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.json b/versions.json index 8ea17f978c..aa70beebfd 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { - "app": "11.8.3", + "app": "11.8.4", "xcode": "16.2", "bazel": "7.3.1:981f82a470bad1349322b6f51c9c6ffa0aa291dab1014fac411543c12e661dff", "macos": "15" From b7f6ed21079154863413b8963ab0e651a6a97d9c Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Fri, 21 Mar 2025 10:49:59 +0100 Subject: [PATCH 5/5] Fix image serialization --- .../SyncCore/SyncCore_TelegramMediaImage.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaImage.swift b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaImage.swift index cec68c6e50..edf28bd600 100644 --- a/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaImage.swift +++ b/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaImage.swift @@ -601,6 +601,17 @@ public final class TelegramMediaImageRepresentation: PostboxCoding, Equatable, C TelegramCore_TelegramMediaImageRepresentation.add(hasVideo: self.hasVideo, &builder) TelegramCore_TelegramMediaImageRepresentation.add(isPersonal: self.isPersonal, &builder) + let mappedTypeHint: TelegramCore_TelegramMediaImageRepresentation_TypeHint + switch self.typeHint { + case .generic: + mappedTypeHint = .generic + case .animated: + mappedTypeHint = .animated + case .video: + mappedTypeHint = .video + } + TelegramCore_TelegramMediaImageRepresentation.add(typeHint: mappedTypeHint, &builder) + return TelegramCore_TelegramMediaImageRepresentation.endTelegramMediaImageRepresentation(&builder, start: start) }