From 8ec01e9bd2c02805e2613a6da859e54aaf121d48 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 19 Oct 2020 20:51:01 +0400 Subject: [PATCH] Various fixes --- .../Sources/TGMediaAssetModernImageSignals.m | 4 ++-- .../LegacyComponents/Sources/TGMediaAssetsController.m | 6 ++++++ .../Sources/PendingMessageUploadedContent.swift | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/submodules/LegacyComponents/Sources/TGMediaAssetModernImageSignals.m b/submodules/LegacyComponents/Sources/TGMediaAssetModernImageSignals.m index 8aed6ebb4c..c8cf1d0e13 100644 --- a/submodules/LegacyComponents/Sources/TGMediaAssetModernImageSignals.m +++ b/submodules/LegacyComponents/Sources/TGMediaAssetModernImageSignals.m @@ -302,7 +302,7 @@ if (iosMajorVersion() >= 10 && [dataUTI rangeOfString:@"heic"].location != NSNotFound) { -#if !DEBUG +//#if !DEBUG CIContext *context = [[CIContext alloc] init]; CIImage *image = [[CIImage alloc] initWithData:imageData]; NSURL *tmpURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSString alloc] initWithFormat:@"%x.jpg", (int)arc4random()]]]; @@ -318,7 +318,7 @@ if (range.location != NSNotFound) fileName = [fileName stringByReplacingCharactersInRange:range withString:@".JPG"]; } -#endif +//#endif } TGMediaAssetImageData *data = [[TGMediaAssetImageData alloc] init]; diff --git a/submodules/LegacyComponents/Sources/TGMediaAssetsController.m b/submodules/LegacyComponents/Sources/TGMediaAssetsController.m index 25327d303a..4a1d105013 100644 --- a/submodules/LegacyComponents/Sources/TGMediaAssetsController.m +++ b/submodules/LegacyComponents/Sources/TGMediaAssetsController.m @@ -762,6 +762,8 @@ return generatedItem; }]; }]]; + + i++; } else { @@ -863,6 +865,8 @@ return generatedItem; }]; }]]; + + i++; } else { @@ -983,6 +987,8 @@ id generatedItem = descriptionGenerator(dict, caption, entities, nil); return generatedItem; }]]; + + i++; } else { diff --git a/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift b/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift index ef21c53ddf..e9985e09de 100644 --- a/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift +++ b/submodules/TelegramCore/Sources/PendingMessageUploadedContent.swift @@ -724,6 +724,10 @@ private func uploadedMediaFileContent(network: Network, postbox: Postbox, auxili flags |= 1 << 3 } + if !file.isVideo && file.mimeType.hasPrefix("video/") { + flags |= 1 << 4 + } + var stickers: [Api.InputDocument]? for attribute in attributes { if let attribute = attribute as? EmbeddedMediaStickersMessageAttribute {