From 48b0250cd0b6f34bdef75bd9f4419b74f87d710d Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 18:49:36 +0400 Subject: [PATCH 1/8] Fix RTL --- submodules/Display/Display/TextNode.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/submodules/Display/Display/TextNode.swift b/submodules/Display/Display/TextNode.swift index 7217a3cb4f..5a5797a1be 100644 --- a/submodules/Display/Display/TextNode.swift +++ b/submodules/Display/Display/TextNode.swift @@ -60,9 +60,10 @@ private func displayLineFrame(frame: CGRect, isRTL: Bool, boundingRect: CGRect, return frame } var lineFrame = frame + let intersectionFrame = lineFrame.offsetBy(dx: 0.0, dy: -lineFrame.height) + if isRTL { lineFrame.origin.x = max(0.0, floor(boundingRect.width - lineFrame.size.width)) - let intersectionFrame = lineFrame.offsetBy(dx: 0.0, dy: -lineFrame.height / 4.5) if let topRight = cutout?.topRight { let topRightRect = CGRect(origin: CGPoint(x: boundingRect.width - topRight.width, y: 0.0), size: topRight) if intersectionFrame.intersects(topRightRect) { From 067543f6f48e0f714a8a03db10069c437be10997 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 18:49:49 +0400 Subject: [PATCH 2/8] Don't crash in production --- .../MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift b/submodules/MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift index 51743bc2db..5040178a67 100644 --- a/submodules/MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift +++ b/submodules/MediaPlayer/Sources/FFMpegMediaFrameSourceContext.swift @@ -75,7 +75,7 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa let readCount = min(resourceSize - context.readingOffset, Int(bufferSize)) let requestRange: Range = context.readingOffset ..< (context.readingOffset + readCount) - precondition(readCount < 3 * 1024 * 1024) + assert(readCount < 16 * 1024 * 1024) if let maximumFetchSize = context.maximumFetchSize { context.touchedRanges.insert(integersIn: requestRange) From 41c0d81c2c9c5345e0482fa16b3ea16b3b60b96f Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 19:16:54 +0400 Subject: [PATCH 3/8] Fix missing method --- submodules/OpusBinding/Sources/OggOpusReader.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/OpusBinding/Sources/OggOpusReader.m b/submodules/OpusBinding/Sources/OggOpusReader.m index bf569da19f..5e8bd5af53 100644 --- a/submodules/OpusBinding/Sources/OggOpusReader.m +++ b/submodules/OpusBinding/Sources/OggOpusReader.m @@ -10,7 +10,7 @@ @implementation OggOpusReader -- (instancetype _Nullable)init:(NSString *)path { +- (instancetype _Nullable)initWithPath:(NSString *)path { self = [super init]; if (self != nil) { int error = OPUS_OK; From 228b8ee9977aa7ea690b994ab2dc770b23e96958 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 19:17:13 +0400 Subject: [PATCH 4/8] Only apply offset when it's an iPad --- .../GlobalOverlayPresentationContext.swift | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/submodules/Display/Display/GlobalOverlayPresentationContext.swift b/submodules/Display/Display/GlobalOverlayPresentationContext.swift index 7c06bc8a0e..b0b89b2d24 100644 --- a/submodules/Display/Display/GlobalOverlayPresentationContext.swift +++ b/submodules/Display/Display/GlobalOverlayPresentationContext.swift @@ -119,7 +119,11 @@ final class GlobalOverlayPresentationContext { } } if let presentationView = self.currentPresentationView(underStatusBar: underStatusBar), let initialLayout = self.layout { - controller.view.frame = CGRect(origin: CGPoint(x: presentationView.bounds.width - initialLayout.size.width, y: 0.0), size: initialLayout.size) + if initialLayout.metrics.widthClass == .regular { + controller.view.frame = CGRect(origin: CGPoint(x: presentationView.bounds.width - initialLayout.size.width, y: 0.0), size: initialLayout.size) + } else { + controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: initialLayout.size) + } controller.containerLayoutUpdated(initialLayout, transition: .immediate) self.presentationDisposables.add(controllerReady.start(next: { [weak self] _ in @@ -137,7 +141,11 @@ final class GlobalOverlayPresentationContext { }, rootController: nil) (controller as? UIViewController)?.setIgnoreAppearanceMethodInvocations(true) if layout != initialLayout { - controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size) + if layout.metrics.widthClass == .regular { + controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size) + } else { + controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: layout.size) + } view.addSubview(controller.view) controller.containerLayoutUpdated(layout, transition: .immediate) } else { @@ -204,7 +212,11 @@ final class GlobalOverlayPresentationContext { } view.addSubview(controller.view) if !justMove { - controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size) + if layout.metrics.widthClass == .regular { + controller.view.frame = CGRect(origin: CGPoint(x: view.bounds.width - layout.size.width, y: 0.0), size: layout.size) + } else { + controller.view.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: layout.size) + } controller.containerLayoutUpdated(layout, transition: .immediate) controller.viewDidAppear(false) } From 3a93972bbcde47323a2adb5d06b78f7c11d8c5a7 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 19:18:06 +0400 Subject: [PATCH 5/8] Bump version number --- NotificationContent/Info.plist | 2 +- NotificationService/Info.plist | 2 +- Share/Info.plist | 2 +- SiriIntents/Info.plist | 2 +- Telegram-iOS/Info.plist | 2 +- Watch/App/Info.plist | 2 +- Watch/Extension/Info.plist | 2 +- Widget/Info.plist | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NotificationContent/Info.plist b/NotificationContent/Info.plist index 63a5db75f2..f982785438 100644 --- a/NotificationContent/Info.plist +++ b/NotificationContent/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/NotificationService/Info.plist b/NotificationService/Info.plist index 14cecfaf70..b744f4746d 100644 --- a/NotificationService/Info.plist +++ b/NotificationService/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Share/Info.plist b/Share/Info.plist index 9ce95e61f2..21a471347b 100644 --- a/Share/Info.plist +++ b/Share/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index ff9f035c1e..d6b99942eb 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Telegram-iOS/Info.plist b/Telegram-iOS/Info.plist index 0c3c9d00ae..501fd34c18 100644 --- a/Telegram-iOS/Info.plist +++ b/Telegram-iOS/Info.plist @@ -185,7 +185,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.11 + 5.12 CFBundleSignature ???? CFBundleURLTypes diff --git a/Watch/App/Info.plist b/Watch/App/Info.plist index dbf2e283c9..651ef9ce4a 100644 --- a/Watch/App/Info.plist +++ b/Watch/App/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} UISupportedInterfaceOrientations diff --git a/Watch/Extension/Info.plist b/Watch/Extension/Info.plist index 08c256367e..963171e6e6 100644 --- a/Watch/Extension/Info.plist +++ b/Watch/Extension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Widget/Info.plist b/Widget/Info.plist index 4c71d0c0a8..103bb1a25a 100644 --- a/Widget/Info.plist +++ b/Widget/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.11 + 5.12 CFBundleVersion ${BUILD_NUMBER} NSExtension From e6bb62115a955558216809dbe35030d042a03a05 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Sat, 7 Sep 2019 19:50:25 +0400 Subject: [PATCH 6/8] Fix animated stickers in secret chats --- submodules/TelegramUI/TelegramUI/ChatMessageItem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift index 0f5cd71c96..5d39e2bc3a 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageItem.swift @@ -370,7 +370,7 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible { loop: for media in self.message.media { if let telegramFile = media as? TelegramMediaFile { - if telegramFile.isAnimatedSticker, !telegramFile.previewRepresentations.isEmpty, let size = telegramFile.size, size > 0 && size <= 128 * 1024 { + if telegramFile.isAnimatedSticker, (self.message.id.peerId.namespace == Namespaces.Peer.SecretChat || !telegramFile.previewRepresentations.isEmpty), let size = telegramFile.size, size > 0 && size <= 128 * 1024 { if self.message.id.peerId.namespace == Namespaces.Peer.SecretChat { if telegramFile.fileId.namespace == Namespaces.Media.CloudFile { viewClassName = ChatMessageAnimatedStickerItemNode.self From 09a25d743311e4247a2115ace08d20a626d7a33c Mon Sep 17 00:00:00 2001 From: Peter <> Date: Mon, 9 Sep 2019 01:22:08 +0400 Subject: [PATCH 7/8] Bump version back --- NotificationContent/Info.plist | 2 +- NotificationService/Info.plist | 2 +- Share/Info.plist | 2 +- SiriIntents/Info.plist | 2 +- Telegram-iOS/Info.plist | 2 +- Watch/App/Info.plist | 2 +- Watch/Extension/Info.plist | 2 +- Widget/Info.plist | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/NotificationContent/Info.plist b/NotificationContent/Info.plist index f982785438..8794b5e261 100644 --- a/NotificationContent/Info.plist +++ b/NotificationContent/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/NotificationService/Info.plist b/NotificationService/Info.plist index b744f4746d..d5ceb753c7 100644 --- a/NotificationService/Info.plist +++ b/NotificationService/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Share/Info.plist b/Share/Info.plist index 21a471347b..ac2fd93455 100644 --- a/Share/Info.plist +++ b/Share/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index d6b99942eb..2806e7beb8 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Telegram-iOS/Info.plist b/Telegram-iOS/Info.plist index 501fd34c18..edca0ccf74 100644 --- a/Telegram-iOS/Info.plist +++ b/Telegram-iOS/Info.plist @@ -185,7 +185,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleSignature ???? CFBundleURLTypes diff --git a/Watch/App/Info.plist b/Watch/App/Info.plist index 651ef9ce4a..1f41b6612e 100644 --- a/Watch/App/Info.plist +++ b/Watch/App/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} UISupportedInterfaceOrientations diff --git a/Watch/Extension/Info.plist b/Watch/Extension/Info.plist index 963171e6e6..976d51af4a 100644 --- a/Watch/Extension/Info.plist +++ b/Watch/Extension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Widget/Info.plist b/Widget/Info.plist index 103bb1a25a..c4dbc30710 100644 --- a/Widget/Info.plist +++ b/Widget/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.12 + 5.11.1 CFBundleVersion ${BUILD_NUMBER} NSExtension From 61fde3100d98d66a3e5b5c3f4efb973e4048a402 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Mon, 9 Sep 2019 01:22:24 +0400 Subject: [PATCH 8/8] Fix blur animations on older systems --- submodules/ContextUI/Sources/ContextController.swift | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/submodules/ContextUI/Sources/ContextController.swift b/submodules/ContextUI/Sources/ContextController.swift index 9f27b28a6f..daf36b26f7 100644 --- a/submodules/ContextUI/Sources/ContextController.swift +++ b/submodules/ContextUI/Sources/ContextController.swift @@ -366,8 +366,10 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi }) } } else { + self.effectView.effect = makeCustomZoomBlurEffect() + self.effectView.alpha = 0.0 UIView.animate(withDuration: 0.2 * animationDurationFactor, animations: { - self.effectView.effect = makeCustomZoomBlurEffect() + self.effectView.alpha = 1.0 }, completion: { [weak self] _ in self?.didCompleteAnimationIn = true }) @@ -478,11 +480,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi self.effectView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.05 * animationDurationFactor, delay: 0.15, timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, removeOnCompletion: false) } else { UIView.animate(withDuration: 0.21 * animationDurationFactor, animations: { - if #available(iOS 9.0, *) { - self.effectView.effect = nil - } else { - self.effectView.alpha = 0.0 - } + self.effectView.alpha = 0.0 }, completion: { _ in completedEffect = true intermediateCompletion()