Merge branch 'beta' of gitlab.com:peter-iakovlev/telegram-ios into beta

This commit is contained in:
Ilya Laktyushin
2019-09-09 11:34:01 +03:00
14 changed files with 32 additions and 21 deletions

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -185,7 +185,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>UISupportedInterfaceOrientations</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<string>5.11.1</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>NSExtension</key>

View File

@@ -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()

View File

@@ -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)
}

View File

@@ -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) {

View File

@@ -75,7 +75,7 @@ private func readPacketCallback(userData: UnsafeMutableRawPointer?, buffer: Unsa
let readCount = min(resourceSize - context.readingOffset, Int(bufferSize))
let requestRange: Range<Int> = 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)

View File

@@ -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;

View File

@@ -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