diff --git a/NotificationContent/Info.plist b/NotificationContent/Info.plist index fc4fb2678a..c99413d85f 100644 --- a/NotificationContent/Info.plist +++ b/NotificationContent/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/NotificationService/Info.plist b/NotificationService/Info.plist index de5dc6bfcd..56035c8f67 100644 --- a/NotificationService/Info.plist +++ b/NotificationService/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Share/Info.plist b/Share/Info.plist index a28ea585bc..7dafb6a695 100644 --- a/Share/Info.plist +++ b/Share/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension @@ -31,15 +31,15 @@ SUBQUERY ( $extensionItem.attachments, $attachment, - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.audio" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.vcard" || - ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.apple.pkpass" + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.file-url" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.image" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.audio" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.vcard" || + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.apple.pkpass" ).@count == $extensionItem.attachments.@count ).@count > 0 diff --git a/SiriIntents/Info.plist b/SiriIntents/Info.plist index 2a6a05825c..cbb4b58170 100644 --- a/SiriIntents/Info.plist +++ b/SiriIntents/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/SiriIntents/IntentHandler.swift b/SiriIntents/IntentHandler.swift index c74f61d180..4958020e72 100644 --- a/SiriIntents/IntentHandler.swift +++ b/SiriIntents/IntentHandler.swift @@ -326,13 +326,12 @@ class IntentHandler: INExtension, INSendMessageIntentHandling, INSearchForMessag |> introduceError(IntentHandlingError.self) |> mapToSignal { account -> Signal<[INMessage], IntentHandlingError> in account.shouldBeServiceTaskMaster.set(.single(.now)) - let completedUpdating: Signal = (.single(true) |> then(account.stateManager.isUpdating)) |> introduceError(IntentHandlingError.self) |> filter { !$0 } |> take(1) |> timeout(3.0, queue: Queue.mainQueue(), alternate: .fail(.generic)) - + return completedUpdating |> mapToSignal { value -> Signal<[INMessage], IntentHandlingError> in return unreadMessages(account: account) diff --git a/Telegram-iOS/Info.plist b/Telegram-iOS/Info.plist index 83072fc8ce..cd79a390f3 100644 --- a/Telegram-iOS/Info.plist +++ b/Telegram-iOS/Info.plist @@ -185,7 +185,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleSignature ???? CFBundleURLTypes diff --git a/Watch/App/Info.plist b/Watch/App/Info.plist index a24eeb4c0d..6a22ec2a10 100644 --- a/Watch/App/Info.plist +++ b/Watch/App/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} UISupportedInterfaceOrientations diff --git a/Watch/Extension/Info.plist b/Watch/Extension/Info.plist index 7d5914d543..4b90eb9880 100644 --- a/Watch/Extension/Info.plist +++ b/Watch/Extension/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/Widget/Info.plist b/Widget/Info.plist index 74ebe90850..beab95bb21 100644 --- a/Widget/Info.plist +++ b/Widget/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 5.9.1 + 5.10 CFBundleVersion ${BUILD_NUMBER} NSExtension diff --git a/submodules/MediaPlayer/Sources/UniversalSoftwareVideoSource.swift b/submodules/MediaPlayer/Sources/UniversalSoftwareVideoSource.swift index 2d098b723d..e688160779 100644 --- a/submodules/MediaPlayer/Sources/UniversalSoftwareVideoSource.swift +++ b/submodules/MediaPlayer/Sources/UniversalSoftwareVideoSource.swift @@ -120,7 +120,7 @@ private final class UniversalSoftwareVideoSourceImpl { self.cancelRead = cancelInitialization - let ioBufferSize = 64 * 1024 + let ioBufferSize = 1 * 1024 guard let avIoContext = FFMpegAVIOContext(bufferSize: Int32(ioBufferSize), opaqueContext: Unmanaged.passUnretained(self).toOpaque(), readPacket: readPacketCallback, seek: seekCallback) else { return nil diff --git a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift index edac983b71..065478e63d 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDarkPresentationTheme.swift @@ -318,9 +318,9 @@ private func makeDarkPresentationTheme(accentColor: UIColor, preview: Bool) -> P ) } -public let defaultDarkPresentationTheme = makeDarkPresentationTheme(accentColor: UIColor(rgb: 0x2ea6ff), preview: false) +public let defaultDarkPresentationTheme = makeDarkPresentationTheme(accentColor: .white, preview: false) public func makeDarkPresentationTheme(accentColor: UIColor?, preview: Bool) -> PresentationTheme { - let accentColor = accentColor ?? defaultDayAccentColor + let accentColor = accentColor ?? .white return makeDarkPresentationTheme(accentColor: accentColor, preview: preview) } diff --git a/submodules/TelegramPresentationData/Sources/MakePresentationTheme.swift b/submodules/TelegramPresentationData/Sources/MakePresentationTheme.swift index cb009ad90a..b272f8a9c2 100644 --- a/submodules/TelegramPresentationData/Sources/MakePresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/MakePresentationTheme.swift @@ -2,7 +2,7 @@ import Foundation import UIKit import TelegramUIPreferences -public func makePresentationTheme(themeReference: PresentationThemeReference, accentColor: UIColor, serviceBackgroundColor: UIColor, preview: Bool = false) -> PresentationTheme { +public func makePresentationTheme(themeReference: PresentationThemeReference, accentColor: UIColor?, serviceBackgroundColor: UIColor, preview: Bool = false) -> PresentationTheme { let theme: PresentationTheme switch themeReference { case let .builtin(reference): diff --git a/submodules/TelegramPresentationData/Sources/PresentationData.swift b/submodules/TelegramPresentationData/Sources/PresentationData.swift index e8d98245bb..91eedc9b8c 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationData.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationData.swift @@ -258,7 +258,7 @@ public func currentPresentationDataAndSettings(accountManager: AccountManager) - effectiveTheme = themeSettings.theme } - let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor + let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: defaultServiceBackgroundColor) if effectiveTheme != themeSettings.theme { @@ -522,8 +522,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI effectiveTheme = themeSettings.theme } - let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color ?? defaultDayAccentColor - + let effectiveAccentColor = themeSettings.themeSpecificAccentColors[effectiveTheme.index]?.color let themeValue = makePresentationTheme(themeReference: effectiveTheme, accentColor: effectiveAccentColor, serviceBackgroundColor: serviceBackgroundColor) if effectiveTheme != themeSettings.theme && themeSettings.themeSpecificChatWallpapers[effectiveTheme.index] == nil { diff --git a/submodules/TelegramUI/TelegramUI/AnimatedStickerUtils.swift b/submodules/TelegramUI/TelegramUI/AnimatedStickerUtils.swift index 10c14c80bc..b5429c89c8 100644 --- a/submodules/TelegramUI/TelegramUI/AnimatedStickerUtils.swift +++ b/submodules/TelegramUI/TelegramUI/AnimatedStickerUtils.swift @@ -311,18 +311,23 @@ func fetchLocalBundleResource(postbox: Postbox, resource: LocalBundleResource) - } } -private let emojis: [String: String] = [ - "👍": "thumbsup", - "😂": "lol", - "😒": "meh", - "❤️": "heart", - "🥳": "celeb", - "😳": "confused" +private let emojis: [String: (String, CGFloat)] = [ + "👍": ("thumbs_up_1", 450.0), + "👍🏻": ("thumbs_up_2", 450.0), + "👍🏼": ("thumbs_up_3", 450.0), + "👍🏽": ("thumbs_up_4", 450.0), + "👍🏾": ("thumbs_up_5", 450.0), + "👍🏿": ("thumbs_up_6", 450.0), + "😂": ("lol", 350.0), + "😒": ("meh", 350.0), + "❤️": ("heart", 350.0), + "🥳": ("celeb", 430.0), + "😳": ("confused", 350.0) ] -func animatedEmojiResource(emoji: String) -> LocalBundleResource? { - if let name = emojis[emoji] { - return LocalBundleResource(name: name, ext: "tgs") +func animatedEmojiResource(emoji: String) -> (LocalBundleResource, CGFloat)? { + if let (name, size) = emojis[emoji] { + return (LocalBundleResource(name: name, ext: "tgs"), size) } else { return nil } diff --git a/submodules/TelegramUI/TelegramUI/AppDelegate.swift b/submodules/TelegramUI/TelegramUI/AppDelegate.swift index d80e22de31..799a63c299 100644 --- a/submodules/TelegramUI/TelegramUI/AppDelegate.swift +++ b/submodules/TelegramUI/TelegramUI/AppDelegate.swift @@ -1870,8 +1870,8 @@ final class SharedApplicationContext { unknownMessageCategory = UNNotificationCategory(identifier: "unknown", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options) replyMessageCategory = UNNotificationCategory(identifier: "withReply", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions) replyLegacyMessageCategory = UNNotificationCategory(identifier: "r", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions) - replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options) - replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions) + replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions) + replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: carPlayOptions) legacyChannelMessageCategory = UNNotificationCategory(identifier: "c", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options) muteMessageCategory = UNNotificationCategory(identifier: "withMute", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options) muteMediaMessageCategory = UNNotificationCategory(identifier: "withMuteMedia", actions: [], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenContentString, options: options) @@ -1882,7 +1882,7 @@ final class SharedApplicationContext { replyMessageCategory = UNNotificationCategory(identifier: "withReply", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions) replyLegacyMessageCategory = UNNotificationCategory(identifier: "r", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions) replyLegacyMediaMessageCategory = UNNotificationCategory(identifier: "m", actions: [reply], intentIdentifiers: [], options: []) - replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [], options: carPlayOptions) + replyMediaMessageCategory = UNNotificationCategory(identifier: "withReplyMedia", actions: [reply], intentIdentifiers: [INSearchForMessagesIntentIdentifier], options: carPlayOptions) legacyChannelMessageCategory = UNNotificationCategory(identifier: "c", actions: [], intentIdentifiers: [], options: []) muteMessageCategory = UNNotificationCategory(identifier: "withMute", actions: [], intentIdentifiers: [], options: []) muteMediaMessageCategory = UNNotificationCategory(identifier: "withMuteMedia", actions: [], intentIdentifiers: [], options: []) diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift index 4eb96bb0a0..fda6d0d21d 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageAnimatedStickerItemNode.swift @@ -39,6 +39,8 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { private var highlightedState: Bool = false + private var hapticFeedback: HapticFeedback? + private var currentSwipeToReplyTranslation: CGFloat = 0.0 required init() { @@ -134,7 +136,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { } if self.telegramFile == nil { - self.emojiResource = animatedEmojiResource(emoji: item.message.text) + self.emojiResource = animatedEmojiResource(emoji: item.message.text)?.0 if let emojiResource = self.emojiResource { let dummyFile = TelegramMediaFile(fileId: MediaId(namespace: 0, id: 0), partialReference: nil, resource: emojiResource, previewRepresentations: [], immediateThumbnailData: nil, mimeType: "", size: 0, attributes: []) @@ -195,27 +197,18 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { return { item, params, mergedTop, mergedBottom, dateHeaderAtBottom in let incoming = item.message.effectivelyIncoming(item.context.account.peerId) var imageSize: CGSize = CGSize(width: 200.0, height: 200.0) + var isEmoji = false if let telegramFile = telegramFile { - var displaySize = displaySize - if !GlobalExperimentalSettings.isAppStoreBuild, let fileName = telegramFile.fileName { - let components = fileName.components(separatedBy: "_size") - if let size = components.last?.lowercased() { - var size = size - size.removeLast(4) - if let sizeValue = Int(size), sizeValue > 0 && sizeValue < 512 { - let side: CGFloat = floor(displaySize.width * CGFloat(sizeValue) / 512.0) - displaySize = CGSize(width: side, height: side) - } - } - } - if let dimensions = telegramFile.dimensions { imageSize = dimensions.aspectFitted(displaySize) } else if let thumbnailSize = telegramFile.previewRepresentations.first?.dimensions { imageSize = thumbnailSize.aspectFitted(displaySize) } } else { - imageSize = CGSize(width: floor(displaySize.width * 0.683), height: floor(displaySize.height * 0.683)) + if let (_, size) = animatedEmojiResource(emoji: item.message.text) { + imageSize = CGSize(width: floor(displaySize.width * size / 512.0), height: floor(displaySize.height * size / 512.0)) + isEmoji = true + } } let avatarInset: CGFloat @@ -301,7 +294,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { let imageInset: CGFloat = 10.0 let innerImageSize = imageSize imageSize = CGSize(width: imageSize.width + imageInset * 2.0, height: imageSize.height + imageInset * 2.0) - let imageFrame = CGRect(origin: CGPoint(x: 0.0 + (incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + avatarInset + layoutConstants.bubble.contentInsets.left) : (params.width - params.rightInset - imageSize.width - layoutConstants.bubble.edgeInset - layoutConstants.bubble.contentInsets.left - deliveryFailedInset)), y: 0.0), size: CGSize(width: imageSize.width, height: imageSize.height)) + var imageFrame = CGRect(origin: CGPoint(x: 0.0 + (incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + avatarInset + layoutConstants.bubble.contentInsets.left) : (params.width - params.rightInset - imageSize.width - layoutConstants.bubble.edgeInset - layoutConstants.bubble.contentInsets.left - deliveryFailedInset)), y: 0.0), size: CGSize(width: imageSize.width, height: imageSize.height)) + if isEmoji { + imageFrame = imageFrame.offsetBy(dx: incoming ? -imageInset : imageInset, dy: 0.0) + } let arguments = TransformImageArguments(corners: ImageCorners(), imageSize: innerImageSize, boundingSize: innerImageSize, intrinsicInsets: UIEdgeInsets(top: imageInset, left: imageInset, bottom: imageInset, right: imageInset)) @@ -648,7 +644,34 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView { } if let item = self.item, self.imageNode.frame.contains(location) { - let _ = item.controllerInteraction.openMessage(item.message, .default) + if self.telegramFile != nil { + let _ = item.controllerInteraction.openMessage(item.message, .default) + } else if let emoji = self.emojiResource, emoji.name == "heart" { + let hapticFeedback: HapticFeedback + if let currentHapticFeedback = self.hapticFeedback { + hapticFeedback = currentHapticFeedback + } else { + hapticFeedback = HapticFeedback() + self.hapticFeedback = hapticFeedback + } + hapticFeedback.prepareImpact() + hapticFeedback.impact(.heavy) + Queue.mainQueue().after(0.2) { + hapticFeedback.impact(.medium) + Queue.mainQueue().after(0.68) { + hapticFeedback.impact(.medium) + Queue.mainQueue().after(0.2) { + hapticFeedback.impact(.medium) + Queue.mainQueue().after(0.68) { + hapticFeedback.impact(.medium) + Queue.mainQueue().after(0.2) { + hapticFeedback.impact(.medium) + } + } + } + } + } + } return } diff --git a/submodules/TelegramUI/TelegramUI/NavigationBarSearchContentNode.swift b/submodules/TelegramUI/TelegramUI/NavigationBarSearchContentNode.swift index 3f09c011ba..cfda4fccc3 100644 --- a/submodules/TelegramUI/TelegramUI/NavigationBarSearchContentNode.swift +++ b/submodules/TelegramUI/TelegramUI/NavigationBarSearchContentNode.swift @@ -75,7 +75,7 @@ class NavigationBarSearchContentNode: NavigationBarContentNode { func updateExpansionProgress(_ progress: CGFloat, animated: Bool = false) { let newProgress = max(0.0, min(10.0, progress)) - if abs(newProgress - self.expansionProgress) > 0.0001 && (progress <= 1.0 || self.expansionProgress != 1.0) { + if abs(newProgress - self.expansionProgress) > 0.0001 { self.expansionProgress = newProgress let transition: ContainedViewLayoutTransition = animated ? .animated(duration: 0.3, curve: ContainedViewLayoutTransitionCurve.slide) : .immediate diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/celeb.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/celeb.tgs index 973c6be963..98e16ae512 100644 Binary files a/submodules/TelegramUI/TelegramUI/Resources/Emoji/celeb.tgs and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/celeb.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/confused.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/confused.tgs index 4abce8d46a..66a06df907 100644 Binary files a/submodules/TelegramUI/TelegramUI/Resources/Emoji/confused.tgs and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/confused.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/heart.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/heart.tgs index 5cf76fd2ab..f8fd248599 100644 Binary files a/submodules/TelegramUI/TelegramUI/Resources/Emoji/heart.tgs and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/heart.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/meh.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/meh.tgs index 011e2dfa02..78d31f59b2 100644 Binary files a/submodules/TelegramUI/TelegramUI/Resources/Emoji/meh.tgs and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/meh.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_1.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_1.tgs new file mode 100644 index 0000000000..a4ac5afca8 Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_1.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_2.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_2.tgs new file mode 100644 index 0000000000..c251cb8632 Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_2.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_3.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_3.tgs new file mode 100644 index 0000000000..d0b7082ad9 Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_3.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_4.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_4.tgs new file mode 100644 index 0000000000..a50062e80d Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_4.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_5.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_5.tgs new file mode 100644 index 0000000000..aa85f8a9a4 Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_5.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_6.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_6.tgs new file mode 100644 index 0000000000..6e351e28be Binary files /dev/null and b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbs_up_6.tgs differ diff --git a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbsup.tgs b/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbsup.tgs deleted file mode 100644 index 5e7f63778c..0000000000 Binary files a/submodules/TelegramUI/TelegramUI/Resources/Emoji/thumbsup.tgs and /dev/null differ diff --git a/submodules/TelegramUI/TelegramUI/ThemeSettingsAccentColorItem.swift b/submodules/TelegramUI/TelegramUI/ThemeSettingsAccentColorItem.swift index b49f43fc07..17d2bac6d6 100644 --- a/submodules/TelegramUI/TelegramUI/ThemeSettingsAccentColorItem.swift +++ b/submodules/TelegramUI/TelegramUI/ThemeSettingsAccentColorItem.swift @@ -24,7 +24,7 @@ private func generateSwatchImage(color: PresentationThemeAccentColor, selected: context.fillEllipse(in: bounds.insetBy(dx: 4.0, dy: 4.0)) context.strokeEllipse(in: bounds.insetBy(dx: 1.0, dy: 1.0)) - if color.baseColor != .white && color.baseColor != .black { + if false, color.baseColor != .white && color.baseColor != .black { context.setFillColor(UIColor.white.cgColor) context.fillEllipse(in: CGRect(x: 11.0, y: 18.0, width: 4.0, height: 4.0)) context.fillEllipse(in: CGRect(x: 18.0, y: 18.0, width: 4.0, height: 4.0)) diff --git a/submodules/TelegramUI/TelegramUI/ThemeSettingsController.swift b/submodules/TelegramUI/TelegramUI/ThemeSettingsController.swift index b460cde122..75e291f4ca 100644 --- a/submodules/TelegramUI/TelegramUI/ThemeSettingsController.swift +++ b/submodules/TelegramUI/TelegramUI/ThemeSettingsController.swift @@ -235,13 +235,17 @@ private enum ThemeSettingsControllerEntry: ItemListNodeEntry { if theme.overallDarkAppearance { colors = colors.filter { $0 != .black } } + + let defaultColor: PresentationThemeAccentColor if case let .builtin(name) = theme.name, name == .night { colors = colors.filter { $0 != .gray } + defaultColor = PresentationThemeAccentColor(baseColor: .white, value: 0.5) } else { colors = colors.filter { $0 != .white } + defaultColor = PresentationThemeAccentColor(baseColor: .blue, value: 0.5) } - return ThemeSettingsAccentColorItem(theme: theme, sectionId: self.section, colors: colors, currentColor: color ?? PresentationThemeAccentColor(baseColor: .blue, value: 0.5), updated: { color in + return ThemeSettingsAccentColorItem(theme: theme, sectionId: self.section, colors: colors, currentColor: color ?? defaultColor, updated: { color in arguments.selectAccentColor(color) }, toggleSlider: { baseColor in arguments.toggleColorSlider(baseColor == .white || baseColor == .black) @@ -374,7 +378,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The if let themeSpecificWallpaper = current.themeSpecificChatWallpapers[theme.index] { chatWallpaper = themeSpecificWallpaper } else { - let accentColor = current.themeSpecificAccentColors[theme.index]?.color ?? defaultDayAccentColor + let accentColor = current.themeSpecificAccentColors[theme.index]?.color let theme = makePresentationTheme(themeReference: theme, accentColor: accentColor, serviceBackgroundColor: defaultServiceBackgroundColor) chatWallpaper = theme.chat.defaultWallpaper } @@ -410,7 +414,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The return PresentationThemeSettings(chatWallpaper: chatWallpaper, theme: current.theme, themeSpecificAccentColors: themeSpecificAccentColors, themeSpecificChatWallpapers: themeSpecificChatWallpapers, fontSize: current.fontSize, automaticThemeSwitchSetting: current.automaticThemeSwitchSetting, largeEmoji: current.largeEmoji, disableAnimations: current.disableAnimations) }).start() }, toggleColorSlider: { forceHidden in - updateState { $0.withDisplayColorSlider(forceHidden ? false : !$0.displayColorSlider) } + //updateState { $0.withDisplayColorSlider(forceHidden ? false : !$0.displayColorSlider) } }, openAutoNightTheme: { pushControllerImpl?(themeAutoNightSettingsController(context: context)) }, toggleLargeEmoji: { largeEmoji in @@ -436,7 +440,7 @@ public func themeSettingsController(context: AccountContext, focusOnItemTag: The let largeEmoji = settings.largeEmoji let disableAnimations = settings.disableAnimations - let accentColor = settings.themeSpecificAccentColors[settings.theme.index]?.color ?? defaultDayAccentColor + let accentColor = settings.themeSpecificAccentColors[settings.theme.index]?.color let theme = makePresentationTheme(themeReference: settings.theme, accentColor: accentColor, serviceBackgroundColor: defaultServiceBackgroundColor, preview: true) let wallpaper: TelegramWallpaper diff --git a/submodules/TelegramUI/TelegramUI/ThemeSettingsThemeItem.swift b/submodules/TelegramUI/TelegramUI/ThemeSettingsThemeItem.swift index 14a1f7c4aa..4f92609134 100644 --- a/submodules/TelegramUI/TelegramUI/ThemeSettingsThemeItem.swift +++ b/submodules/TelegramUI/TelegramUI/ThemeSettingsThemeItem.swift @@ -59,7 +59,7 @@ private func generateThemeIconImage(theme: PresentationThemeReference, accentCol case .night: background = UIColor(rgb: 0x000000) incomingFill = UIColor(rgb: 0x1f1f1f) - outgoingFill = accentColor ?? UIColor(rgb: 0x007aff) + outgoingFill = accentColor ?? UIColor(rgb: 0x313131) case .nightAccent: let accentColor = accentColor ?? UIColor(rgb: 0x007aff) background = accentColor.withMultiplied(hue: 1.024, saturation: 0.573, brightness: 0.18) @@ -402,7 +402,9 @@ class ThemeSettingsThemeItemNode: ListViewItemNode, ItemListItemNode { let previousBaseColor = strongSelf.colorSlider.baseColor let newBaseColor = item.currentColor?.baseColor ?? .blue - strongSelf.colorSlider.baseColor = newBaseColor + if newBaseColor != .black && newBaseColor != .white { + strongSelf.colorSlider.baseColor = newBaseColor + } if previousBaseColor != newBaseColor { strongSelf.colorSlider.value = item.currentColor?.value ?? 0.5 } diff --git a/submodules/TelegramUI/TelegramUI_Xcode.xcodeproj/project.pbxproj b/submodules/TelegramUI/TelegramUI_Xcode.xcodeproj/project.pbxproj index 4e521f42c1..a9c03c9e22 100644 --- a/submodules/TelegramUI/TelegramUI_Xcode.xcodeproj/project.pbxproj +++ b/submodules/TelegramUI/TelegramUI_Xcode.xcodeproj/project.pbxproj @@ -34,8 +34,13 @@ 091BEAB3214552D9003AEA30 /* Vision.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D02DADBE2138D76F00116225 /* Vision.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 0921F60B228C8765001A13D7 /* ItemListPlaceholderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0921F60A228C8765001A13D7 /* ItemListPlaceholderItem.swift */; }; 0921F60E228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0921F60D228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift */; }; + 0925902C22EF8158003D6283 /* thumbs_up_5.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902622EF8157003D6283 /* thumbs_up_5.tgs */; }; + 0925902D22EF8158003D6283 /* thumbs_up_6.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902722EF8158003D6283 /* thumbs_up_6.tgs */; }; + 0925902E22EF8158003D6283 /* thumbs_up_3.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902822EF8158003D6283 /* thumbs_up_3.tgs */; }; + 0925902F22EF8158003D6283 /* thumbs_up_1.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902922EF8158003D6283 /* thumbs_up_1.tgs */; }; + 0925903022EF8158003D6283 /* thumbs_up_2.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902A22EF8158003D6283 /* thumbs_up_2.tgs */; }; + 0925903122EF8158003D6283 /* thumbs_up_4.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 0925902B22EF8158003D6283 /* thumbs_up_4.tgs */; }; 092A65DB22EF16900032E20C /* lol.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D522EF16900032E20C /* lol.tgs */; }; - 092A65DC22EF16900032E20C /* thumbsup.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D622EF16900032E20C /* thumbsup.tgs */; }; 092A65DD22EF16900032E20C /* meh.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D722EF16900032E20C /* meh.tgs */; }; 092A65DE22EF16900032E20C /* confused.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D822EF16900032E20C /* confused.tgs */; }; 092A65DF22EF16900032E20C /* celeb.tgs in Resources */ = {isa = PBXBuildFile; fileRef = 092A65D922EF16900032E20C /* celeb.tgs */; }; @@ -1272,8 +1277,13 @@ 091954782294754E00E11046 /* AnimatedStickerUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimatedStickerUtils.swift; sourceTree = ""; }; 0921F60A228C8765001A13D7 /* ItemListPlaceholderItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemListPlaceholderItem.swift; sourceTree = ""; }; 0921F60D228EE000001A13D7 /* ChatMessageActionUrlAuthController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatMessageActionUrlAuthController.swift; sourceTree = ""; }; + 0925902622EF8157003D6283 /* thumbs_up_5.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_5.tgs; sourceTree = ""; }; + 0925902722EF8158003D6283 /* thumbs_up_6.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_6.tgs; sourceTree = ""; }; + 0925902822EF8158003D6283 /* thumbs_up_3.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_3.tgs; sourceTree = ""; }; + 0925902922EF8158003D6283 /* thumbs_up_1.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_1.tgs; sourceTree = ""; }; + 0925902A22EF8158003D6283 /* thumbs_up_2.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_2.tgs; sourceTree = ""; }; + 0925902B22EF8158003D6283 /* thumbs_up_4.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbs_up_4.tgs; sourceTree = ""; }; 092A65D522EF16900032E20C /* lol.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = lol.tgs; sourceTree = ""; }; - 092A65D622EF16900032E20C /* thumbsup.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = thumbsup.tgs; sourceTree = ""; }; 092A65D722EF16900032E20C /* meh.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = meh.tgs; sourceTree = ""; }; 092A65D822EF16900032E20C /* confused.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = confused.tgs; sourceTree = ""; }; 092A65D922EF16900032E20C /* celeb.tgs */ = {isa = PBXFileReference; lastKnownFileType = file; path = celeb.tgs; sourceTree = ""; }; @@ -2604,8 +2614,13 @@ 092A65D422EF16900032E20C /* Emoji */ = { isa = PBXGroup; children = ( + 0925902922EF8158003D6283 /* thumbs_up_1.tgs */, + 0925902A22EF8158003D6283 /* thumbs_up_2.tgs */, + 0925902822EF8158003D6283 /* thumbs_up_3.tgs */, + 0925902B22EF8158003D6283 /* thumbs_up_4.tgs */, + 0925902622EF8157003D6283 /* thumbs_up_5.tgs */, + 0925902722EF8158003D6283 /* thumbs_up_6.tgs */, 092A65D522EF16900032E20C /* lol.tgs */, - 092A65D622EF16900032E20C /* thumbsup.tgs */, 092A65D722EF16900032E20C /* meh.tgs */, 092A65D822EF16900032E20C /* confused.tgs */, 092A65D922EF16900032E20C /* celeb.tgs */, @@ -5302,6 +5317,7 @@ 09874E5121078FA100E190B8 /* Instagram.html in Resources */, 09874E5221078FA100E190B8 /* Twitch.html in Resources */, 09874E5321078FA100E190B8 /* TwitchUserScript.js in Resources */, + 0925902F22EF8158003D6283 /* thumbs_up_1.tgs in Resources */, 094735122275D72100EA2312 /* anim_mute.json in Resources */, 09874E5421078FA100E190B8 /* Vimeo.html in Resources */, 09874E5521078FA100E190B8 /* VimeoUserScript.js in Resources */, @@ -5345,6 +5361,7 @@ D0E9BA971F056F4C00F079A4 /* stp_card_applepay_template@2x.png in Resources */, 092A65DD22EF16900032E20C /* meh.tgs in Resources */, D0E9BAB41F056F4C00F079A4 /* stp_card_placeholder_template@3x.png in Resources */, + 0925903022EF8158003D6283 /* thumbs_up_2.tgs in Resources */, D0E9BAA71F056F4C00F079A4 /* stp_card_form_back@2x.png in Resources */, D0E9BAB11F056F4C00F079A4 /* stp_card_mastercard_template@2x.png in Resources */, D0E9BA9D1F056F4C00F079A4 /* stp_card_diners@2x.png in Resources */, @@ -5353,6 +5370,7 @@ D0E9BAAC1F056F4C00F079A4 /* stp_card_jcb@3x.png in Resources */, D0E9BA911F056F4C00F079A4 /* stp_card_amex@2x.png in Resources */, D0E9BA931F056F4C00F079A4 /* stp_card_amex_template@2x.png in Resources */, + 0925903122EF8158003D6283 /* thumbs_up_4.tgs in Resources */, D0E9BAA91F056F4C00F079A4 /* stp_card_form_front@2x.png in Resources */, D0E9BAA41F056F4C00F079A4 /* stp_card_discover_template@3x.png in Resources */, D0E9BAA81F056F4C00F079A4 /* stp_card_form_back@3x.png in Resources */, @@ -5361,6 +5379,8 @@ D0E9B9EA1F00853C00F079A4 /* PhoneCountries.txt in Resources */, 094735152275D72100EA2312 /* anim_unpin.json in Resources */, D0E9BAB31F056F4C00F079A4 /* stp_card_placeholder_template@2x.png in Resources */, + 0925902E22EF8158003D6283 /* thumbs_up_3.tgs in Resources */, + 0925902D22EF8158003D6283 /* thumbs_up_6.tgs in Resources */, D0E9BAAE1F056F4C00F079A4 /* stp_card_jcb_template@3x.png in Resources */, D0E9BAAB1F056F4C00F079A4 /* stp_card_jcb@2x.png in Resources */, 09E2DA132273367900EA0AA4 /* anim_archiveAvatar.json in Resources */, @@ -5371,11 +5391,11 @@ D0E9BAB21F056F4C00F079A4 /* stp_card_mastercard_template@3x.png in Resources */, D0E9BA981F056F4C00F079A4 /* stp_card_applepay_template@3x.png in Resources */, D0E9BAA51F056F4C00F079A4 /* stp_card_form_applepay@2x.png in Resources */, + 0925902C22EF8158003D6283 /* thumbs_up_5.tgs in Resources */, D0E9BAB81F056F4C00F079A4 /* stp_card_visa_template@3x.png in Resources */, D0AF797822C2E26500CECCB8 /* meson.build in Resources */, D0E9BA9B1F056F4C00F079A4 /* stp_card_cvc_amex@2x.png in Resources */, D0E9BAB61F056F4C00F079A4 /* stp_card_visa@3x.png in Resources */, - 092A65DC22EF16900032E20C /* thumbsup.tgs in Resources */, D0E9BAA61F056F4C00F079A4 /* stp_card_form_applepay@3x.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/submodules/ffmpeg/FFMpeg/FFMpegAVFormatContext.m b/submodules/ffmpeg/FFMpeg/FFMpegAVFormatContext.m index 76c1987031..45b732b4ec 100644 --- a/submodules/ffmpeg/FFMpeg/FFMpegAVFormatContext.m +++ b/submodules/ffmpeg/FFMpeg/FFMpegAVFormatContext.m @@ -39,7 +39,7 @@ int FFMpegCodecIdMPEG4 = AV_CODEC_ID_MPEG4; - (bool)openInput { AVDictionary *options = nil; av_dict_set(&options, "usetoc", "1", 0); - int result = avformat_open_input(&_impl, "http://localhost/file", nil, &options); + int result = avformat_open_input(&_impl, "file", nil, &options); av_dict_free(&options); if (_impl != nil) { _impl->flags |= AVFMT_FLAG_FAST_SEEK;