From cfb5d2027aecfbf5ff03804e9e5e924aa0addf2e Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 23 Aug 2019 06:55:33 +0300 Subject: [PATCH] Various UI fixes --- .../NotificationViewController.swift | 1 - Share/ShareRootController.swift | 1 - Telegram-iOS/en.lproj/Localizable.strings | 1 + .../Sources/BotCheckoutControllerNode.swift | 2 +- .../BotCheckoutPasswordEntryController.swift | 1 + .../Sources/BotPaymentFieldItemNode.swift | 2 + .../Sources/ChatListController.swift | 2 +- .../Sources/Node/ChatListItem.swift | 1 - .../Sources/CreatePollOptionItem.swift | 1 + .../DeviceAccess/Sources/DeviceAccess.swift | 8 +- .../Sources/InstantPageFeedbackNode.swift | 2 +- .../InstantPageGalleryFooterContentNode.swift | 2 +- .../Sources/InstantPageTextItem.swift | 6 +- .../Sources/ItemListControllerNode.swift | 2 - .../Items/ItemListMultilineInputItem.swift | 1 + .../Items/ItemListSingleLineInputItem.swift | 2 + .../LegacyComponents/POPAnimation.h | 2 +- .../TGVideoMessageCaptureController.m | 8 +- .../Sources/LegacyMediaPickers.swift | 2 +- .../LegacyUI/Sources/LegacyController.swift | 11 - .../ChatMessageLiveLocationPositionNode.swift | 2 +- .../Sources/PasscodeEntryInputFieldNode.swift | 1 + .../Form/FormControllerTextInputItem.swift | 1 + .../Sources/SecureIdAuthControllerNode.swift | 3 +- ...ecureIdAuthPasswordOptionContentNode.swift | 1 + .../SecureIdDocumentFormControllerNode.swift | 4 +- .../Sources/SecureIdValueFormPhoneItem.swift | 4 +- .../SetupTwoStepVerificationContentNode.swift | 2 + .../Sources/PeerAvatarImageGalleryItem.swift | 6 +- .../ChannelOwnershipTransferController.swift | 4 +- .../Sources/UserInfoEditingPhoneItem.swift | 2 + .../Sources/PhotoResources.swift | 124 +- .../Postbox/Postbox/ItemCollection.swift | 1 + .../Postbox/ItemCollectionItemTable.swift | 2 + .../Postbox/Postbox/MessageHistoryTable.swift | 4 +- submodules/Postbox/Postbox/Postbox.swift | 10 +- .../Postbox/ReverseIndexReferenceTable.swift | 8 +- .../SearchBarNode/Sources/SearchBarNode.swift | 1 + .../ChangePhoneNumberControllerNode.swift | 2 + .../ProxyListSettingsController.swift | 6 +- .../ProxyServerActionSheetController.swift | 2 +- .../ProxyServerSettingsController.swift | 4 +- .../RecentSessionsController.swift | 2 +- .../Themes/WallpaperColorPanelNode.swift | 2 + .../Themes/WallpaperGalleryController.swift | 2 +- .../Sources/Themes/WallpaperGalleryItem.swift | 4 +- .../Sources/ShareInputFieldNode.swift | 10 +- .../Sources/SharePeersContainerNode.swift | 2 +- .../Sources/ShareSearchBarNode.swift | 15 +- .../Sources/ShareSearchContainerNode.swift | 6 +- .../Sources/SolidRoundedButtonNode.swift | 5 +- .../Sources/StickerPackPreviewGridItem.swift | 2 +- .../TelegramCore/DeleteMessages.swift | 4 +- .../DeleteMessagesInteractively.swift | 10 +- ...gedCloudChatRemoveMessagesOperations.swift | 4 +- ...ecretChatIncomingDecryptedOperations.swift | 2 +- .../TelegramCore/RemovePeerChat.swift | 6 +- .../TelegramCore/RequestEditMessage.swift | 6 +- .../TelegramCore/SearchStickers.swift | 2 +- .../Sources/ComponentsThemes.swift | 16 +- .../Sources/DefaultDayPresentationTheme.swift | 2 +- .../Sources/PresentationStrings.swift | 1159 +++++++++-------- .../PresentationResourcesChatList.swift | 1 - .../PresentationResourcesItemList.swift | 1 - .../PresentationResourcesRootController.swift | 1 - .../Sources/StringPluralization.swift | 2 + ...tionSequencePhoneEntryControllerNode.swift | 2 + ...rizationSequenceSignUpControllerNode.swift | 4 + .../TelegramUI/ChatController.swift | 19 +- .../ChatInterfaceInputContexts.swift | 3 +- .../ChatInterfaceStateInputPanels.swift | 16 +- .../ChatMessageBubbleItemNode.swift | 2 +- .../ChatMessagePollBubbleContentNode.swift | 3 + .../ChatScheduleTimeController.swift | 13 + .../ChatScheduleTimeControllerNode.swift | 33 +- .../ChatTextLinkEditController.swift | 6 +- .../TelegramUI/TelegramUI/ChatTitleView.swift | 9 +- .../ContactMultiselectionControllerNode.swift | 2 +- .../TelegramUI/EditableTokenListNode.swift | 12 +- .../TelegramUI/PaneSearchBarNode.swift | 9 +- .../Resources/PresentationStrings.mapping | Bin 124672 -> 124717 bytes .../Sources/WallpaperResources.swift | 4 +- .../Sources/WatchRequestHandlers.swift | 2 + .../Sources/WebSearchControllerNode.swift | 9 +- 84 files changed, 860 insertions(+), 806 deletions(-) diff --git a/NotificationContent/NotificationViewController.swift b/NotificationContent/NotificationViewController.swift index 327854aae7..2c901bb4a2 100644 --- a/NotificationContent/NotificationViewController.swift +++ b/NotificationContent/NotificationViewController.swift @@ -21,7 +21,6 @@ class NotificationViewController: UIViewController, UNNotificationContentExtensi let buildConfig = BuildConfig(baseAppBundleId: baseAppBundleId) - let apiId: Int32 = buildConfig.apiId let languagesCategory = "ios" let appGroupName = "group.\(baseAppBundleId)" diff --git a/Share/ShareRootController.swift b/Share/ShareRootController.swift index 9e30ed6bde..969578d05f 100644 --- a/Share/ShareRootController.swift +++ b/Share/ShareRootController.swift @@ -19,7 +19,6 @@ class ShareRootController: UIViewController { let buildConfig = BuildConfig(baseAppBundleId: baseAppBundleId) - let apiId: Int32 = buildConfig.apiId let languagesCategory = "ios" let appGroupName = "group.\(baseAppBundleId)" diff --git a/Telegram-iOS/en.lproj/Localizable.strings b/Telegram-iOS/en.lproj/Localizable.strings index a45da3d3cd..a3d042db4f 100644 --- a/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram-iOS/en.lproj/Localizable.strings @@ -4614,6 +4614,7 @@ Any member of this group will be able to see messages in the channel."; "ScheduledMessages.DeleteMany" = "Delete Scheduled Messages"; "ScheduledMessages.EmptyPlaceholder" = "No scheduled messages here yet..."; "ScheduledMessages.BotActionUnavailable" = "This action will become available after the message is published."; +"ScheduledMessages.PollUnavailable" = "Voting will become available after the message is published."; "Conversation.SendMessage.SetReminder" = "Set a Reminder"; diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift index 4119dd80e3..0eef514668 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutControllerNode.swift @@ -838,7 +838,7 @@ final class BotCheckoutControllerNode: ItemListControllerNode, } if let shippingOptions = strongSelf.currentValidatedFormInfo?.shippingOptions, let shippingOptionId = strongSelf.currentShippingOptionId { - if let shippingOptionIndex = shippingOptions.index(where: { $0.id == shippingOptionId }) { + if let shippingOptionIndex = shippingOptions.firstIndex(where: { $0.id == shippingOptionId }) { for price in shippingOptions[shippingOptionIndex].prices { totalAmount += price.amount diff --git a/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift b/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift index 044183124f..a7422626cc 100644 --- a/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift +++ b/submodules/BotPaymentsUI/Sources/BotCheckoutPasswordEntryController.swift @@ -154,6 +154,7 @@ private final class BotCheckoutPasswordAlertContentNode: AlertContentNode { self.textFieldNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(12.0)] self.textFieldNode.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance self.textFieldNode.textField.isSecureTextEntry = true + self.textFieldNode.textField.tintColor = theme.list.itemAccentColor super.init() diff --git a/submodules/BotPaymentsUI/Sources/BotPaymentFieldItemNode.swift b/submodules/BotPaymentsUI/Sources/BotPaymentFieldItemNode.swift index 9f6f0685be..6226c05a11 100644 --- a/submodules/BotPaymentsUI/Sources/BotPaymentFieldItemNode.swift +++ b/submodules/BotPaymentsUI/Sources/BotPaymentFieldItemNode.swift @@ -80,6 +80,7 @@ final class BotPaymentFieldItemNode: BotPaymentItemNode, UITextFieldDelegate { self.textField.textField.textColor = theme.list.itemPrimaryTextColor self.textField.textField.attributedPlaceholder = NSAttributedString(string: placeholder, font: titleFont, textColor: theme.list.itemPlaceholderTextColor) self.textField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textField.textField.tintColor = theme.list.itemAccentColor } let leftInset: CGFloat = 16.0 @@ -97,6 +98,7 @@ final class BotPaymentFieldItemNode: BotPaymentItemNode, UITextFieldDelegate { self.theme = theme self.titleNode.attributedText = NSAttributedString(string: self.title, font: titleFont, textColor: theme.list.itemPrimaryTextColor) self.textField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textField.textField.tintColor = theme.list.itemAccentColor } let leftInset: CGFloat = 16.0 diff --git a/submodules/ChatListUI/Sources/ChatListController.swift b/submodules/ChatListUI/Sources/ChatListController.swift index 21ea059670..8dad0a3b23 100644 --- a/submodules/ChatListUI/Sources/ChatListController.swift +++ b/submodules/ChatListUI/Sources/ChatListController.swift @@ -853,7 +853,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController, } self.chatListDisplayNode.isEmptyUpdated = { [weak self] isEmpty in - if let strongSelf = self, let searchContentNode = strongSelf.searchContentNode, let validLayout = strongSelf.validLayout { + if let strongSelf = self, let searchContentNode = strongSelf.searchContentNode, let _ = strongSelf.validLayout { if isEmpty { searchContentNode.updateListVisibleContentOffset(.known(0.0)) } diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index 5fb4d03f4f..129717df82 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -1402,7 +1402,6 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { let titlePosition = strongSelf.titleNode.position transition.animatePosition(node: strongSelf.titleNode, from: CGPoint(x: titlePosition.x - contentDelta.x, y: titlePosition.y - contentDelta.y)) - let textPosition = strongSelf.textNode.position transition.animatePositionAdditive(node: strongSelf.textNode, offset: CGPoint(x: -contentDelta.x, y: -contentDelta.y)) let authorPosition = strongSelf.authorNode.position diff --git a/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift b/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift index c9ebc5f006..6aa6af90e3 100644 --- a/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift +++ b/submodules/ComposePollUI/Sources/CreatePollOptionItem.swift @@ -275,6 +275,7 @@ class CreatePollOptionItemNode: ItemListRevealOptionsItemNode, ItemListItemNode, if strongSelf.isNodeLoaded { strongSelf.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(17.0), NSAttributedString.Key.foregroundColor.rawValue: item.theme.list.itemPrimaryTextColor] + strongSelf.textNode.tintColor = item.theme.list.itemAccentColor } } diff --git a/submodules/DeviceAccess/Sources/DeviceAccess.swift b/submodules/DeviceAccess/Sources/DeviceAccess.swift index 3a2ec05ec6..f0f32bda1f 100644 --- a/submodules/DeviceAccess/Sources/DeviceAccess.swift +++ b/submodules/DeviceAccess/Sources/DeviceAccess.swift @@ -223,6 +223,8 @@ public final class DeviceAccess { subscriber.putNext(.denied) case .notDetermined: subscriber.putNext(.notDetermined) + @unknown default: + fatalError() } subscriber.putCompletion() return EmptyDisposable @@ -333,6 +335,8 @@ public final class DeviceAccess { value = false case .authorized: value = true + @unknown default: + fatalError() } let _ = cachedMediaLibraryAccessStatus.swap(value) continueWithValue(value) @@ -376,7 +380,9 @@ public final class DeviceAccess { } case .notDetermined: completion(true) - } + @unknown default: + fatalError() + } case .contacts: let _ = (self.contactsPromise.get() |> take(1) diff --git a/submodules/InstantPageUI/Sources/InstantPageFeedbackNode.swift b/submodules/InstantPageUI/Sources/InstantPageFeedbackNode.swift index 9805d1847b..37e2e309ec 100644 --- a/submodules/InstantPageUI/Sources/InstantPageFeedbackNode.swift +++ b/submodules/InstantPageUI/Sources/InstantPageFeedbackNode.swift @@ -63,7 +63,7 @@ final class InstantPageFeedbackNode: ASDisplayNode, InstantPageNode { @objc func buttonPressed() { self.resolveDisposable.set((resolvePeerByName(account: self.context.account, name: "previews") |> deliverOnMainQueue).start(next: { [weak self] peerId in - if let strongSelf = self, let peerId = peerId, let webPageId = strongSelf.webPage.id?.id { + if let strongSelf = self, let _ = peerId, let webPageId = strongSelf.webPage.id?.id { strongSelf.openUrl(InstantPageUrlItem(url: "https://t.me/previews?start=webpage\(webPageId)", webpageId: nil)) } })) diff --git a/submodules/InstantPageUI/Sources/InstantPageGalleryFooterContentNode.swift b/submodules/InstantPageUI/Sources/InstantPageGalleryFooterContentNode.swift index 1f075d89c6..6d4bd12264 100644 --- a/submodules/InstantPageUI/Sources/InstantPageGalleryFooterContentNode.swift +++ b/submodules/InstantPageUI/Sources/InstantPageGalleryFooterContentNode.swift @@ -112,7 +112,7 @@ final class InstantPageGalleryFooterContentNode: GalleryFooterContentNode { let sideInset: CGFloat = leftInset + 8.0 let topInset: CGFloat = 0.0 let bottomInset: CGFloat = 0.0 - var textSize = self.textNode.updateLayout(CGSize(width: width - sideInset * 2.0, height: CGFloat.greatestFiniteMagnitude)) + let textSize = self.textNode.updateLayout(CGSize(width: width - sideInset * 2.0, height: CGFloat.greatestFiniteMagnitude)) var x = sideInset if let hasRTL = self.textNode.cachedLayout?.hasRTL, hasRTL { diff --git a/submodules/InstantPageUI/Sources/InstantPageTextItem.swift b/submodules/InstantPageUI/Sources/InstantPageTextItem.swift index 6b67e5b365..3bd1f5caeb 100644 --- a/submodules/InstantPageUI/Sources/InstantPageTextItem.swift +++ b/submodules/InstantPageUI/Sources/InstantPageTextItem.swift @@ -787,12 +787,12 @@ func layoutTextItemWithString(_ string: NSAttributedString, boundingWidth: CGFlo } if requiresScroll { - textItem.frame = textItem.frame.offsetBy(dx: 0.0, dy: fabs(topInset)) + textItem.frame = textItem.frame.offsetBy(dx: 0.0, dy: abs(topInset)) for var item in additionalItems { - item.frame = item.frame.offsetBy(dx: 0.0, dy: fabs(topInset)) + item.frame = item.frame.offsetBy(dx: 0.0, dy: abs(topInset)) } - let scrollableItem = InstantPageScrollableTextItem(frame: CGRect(x: 0.0, y: 0.0, width: boundingWidth + horizontalInset * 2.0, height: height + fabs(topInset) + bottomInset), item: textItem, additionalItems: additionalItems, totalWidth: textWidth, horizontalInset: horizontalInset, rtl: textItem.containsRTL) + let scrollableItem = InstantPageScrollableTextItem(frame: CGRect(x: 0.0, y: 0.0, width: boundingWidth + horizontalInset * 2.0, height: height + abs(topInset) + bottomInset), item: textItem, additionalItems: additionalItems, totalWidth: textWidth, horizontalInset: horizontalInset, rtl: textItem.containsRTL) items.append(scrollableItem) } else { items.append(contentsOf: additionalItems) diff --git a/submodules/ItemListUI/Sources/ItemListControllerNode.swift b/submodules/ItemListUI/Sources/ItemListControllerNode.swift index 8955f4eba2..358ad954c3 100644 --- a/submodules/ItemListUI/Sources/ItemListControllerNode.swift +++ b/submodules/ItemListUI/Sources/ItemListControllerNode.swift @@ -523,13 +523,11 @@ open class ItemListControllerNode: ASDisplayNode, UISc } if updatedFocusItemTag { if let focusItemTag = focusItemTag { - var applied = false strongSelf.listNode.forEachItemNode { itemNode in if let itemNode = itemNode as? ItemListItemNode { if let itemTag = itemNode.tag { if itemTag.isEqual(to: focusItemTag) { if let focusableNode = itemNode as? ItemListItemFocusableNode { - applied = true focusableNode.focus() } } diff --git a/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift b/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift index 271f2a0a56..1fb5e0f02b 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListMultilineInputItem.swift @@ -208,6 +208,7 @@ public class ItemListMultilineInputItemNode: ListViewItemNode, ASEditableTextNod if strongSelf.isNodeLoaded { strongSelf.textNode.typingAttributes = [NSAttributedString.Key.font.rawValue: Font.regular(17.0), NSAttributedString.Key.foregroundColor.rawValue: item.theme.list.itemPrimaryTextColor] + strongSelf.textNode.tintColor = item.theme.list.itemAccentColor } } diff --git a/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift b/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift index b3762f6bb8..8799de23b2 100644 --- a/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift +++ b/submodules/ItemListUI/Sources/Items/ItemListSingleLineInputItem.swift @@ -154,6 +154,7 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg if let item = self.item { self.textNode.textField.textColor = item.theme.list.itemPrimaryTextColor self.textNode.textField.keyboardAppearance = item.theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textNode.textField.tintColor = item.theme.list.itemAccentColor self.textNode.textField.accessibilityHint = item.placeholder } self.textNode.clipsToBounds = true @@ -210,6 +211,7 @@ public class ItemListSingleLineInputItemNode: ListViewItemNode, UITextFieldDeleg strongSelf.textNode.textField.textColor = item.theme.list.itemPrimaryTextColor strongSelf.textNode.textField.keyboardAppearance = item.theme.chatList.searchBarKeyboardColor.keyboardAppearance + strongSelf.textNode.textField.tintColor = item.theme.list.itemAccentColor } let _ = titleApply() diff --git a/submodules/LegacyComponents/LegacyComponents/POPAnimation.h b/submodules/LegacyComponents/LegacyComponents/POPAnimation.h index 2e75c09a8c..521a73f64c 100644 --- a/submodules/LegacyComponents/LegacyComponents/POPAnimation.h +++ b/submodules/LegacyComponents/LegacyComponents/POPAnimation.h @@ -163,7 +163,7 @@ When combined with the autoreverses property, a singular animation is effectivel /** @abstract Returns an array containing the keys of all animations currently attached to the receiver. - @param The order of keys reflects the order in which animations will be applied. + @discussion The order of keys reflects the order in which animations will be applied. */ - (NSArray *)pop_animationKeys; diff --git a/submodules/LegacyComponents/LegacyComponents/TGVideoMessageCaptureController.m b/submodules/LegacyComponents/LegacyComponents/TGVideoMessageCaptureController.m index bf812cf29b..7491c0aec7 100644 --- a/submodules/LegacyComponents/LegacyComponents/TGVideoMessageCaptureController.m +++ b/submodules/LegacyComponents/LegacyComponents/TGVideoMessageCaptureController.m @@ -1330,8 +1330,9 @@ static UIImage *startImage = nil; { NSTimeInterval timestamp = timestampVal.doubleValue; NSNumber *closestTimestamp = [self closestTimestampForTimestamp:timestamp timestamps:thumbnailTimestamps start:i finalIndex:&i]; - - [thumbnails addObject:_thumbnails[closestTimestamp]]; + if (closestTimestamp != nil) { + [thumbnails addObject:_thumbnails[closestTimestamp]]; + } }]; return thumbnails; @@ -1339,6 +1340,9 @@ static UIImage *startImage = nil; - (NSNumber *)closestTimestampForTimestamp:(NSTimeInterval)timestamp timestamps:(NSArray *)timestamps start:(NSUInteger)start finalIndex:(NSUInteger *)finalIndex { + if (start >= timestamps.count) { + return nil; + } NSTimeInterval leftTimestamp = [timestamps[start - 1] doubleValue]; NSTimeInterval rightTimestamp = [timestamps[start] doubleValue]; diff --git a/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift b/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift index dc772c8dca..1bef9419c7 100644 --- a/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift +++ b/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift @@ -183,7 +183,7 @@ public func legacyAssetPickerItemGenerator() -> ((Any?, String?, [Any]?, String? return result } } else if (dict["type"] as! NSString) == "video" { - var thumbnail = dict["previewImage"] as? UIImage + let thumbnail = dict["previewImage"] as? UIImage var asFile = false if let document = dict["document"] as? NSNumber, document.boolValue { asFile = true diff --git a/submodules/LegacyUI/Sources/LegacyController.swift b/submodules/LegacyUI/Sources/LegacyController.swift index bccfc2f78f..50f9d64cce 100644 --- a/submodules/LegacyUI/Sources/LegacyController.swift +++ b/submodules/LegacyUI/Sources/LegacyController.swift @@ -503,21 +503,10 @@ open class LegacyController: ViewController, PresentableController { switch self.presentation { case .modal: self.controllerNode.animateModalOut { [weak self] in - if let controller = self?.legacyController as? TGViewController { - //controller.didDismiss() - } else if let controller = self?.legacyController as? TGNavigationController { - //controller.didDismiss() - } self?.presentingViewController?.dismiss(animated: false, completion: completion) } case .custom: - if let controller = self.legacyController as? TGViewController { - //controller.didDismiss() - } else if let controller = self.legacyController as? TGNavigationController { - //controller.didDismiss() - } self.presentingViewController?.dismiss(animated: false, completion: completion) - case .navigation: break } diff --git a/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift b/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift index 36b3898bfa..7d49098b6f 100644 --- a/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift +++ b/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift @@ -73,7 +73,7 @@ public final class ChatMessageLiveLocationPositionNode: ASDisplayNode { return { [weak self] account, theme, peer, liveActive in let backgroundImage: UIImage? var hasPulse = false - if let peer = peer { + if let _ = peer { backgroundImage = avatarBackgroundImage if let liveActive = liveActive { diff --git a/submodules/PasscodeUI/Sources/PasscodeEntryInputFieldNode.swift b/submodules/PasscodeUI/Sources/PasscodeEntryInputFieldNode.swift index 60f4279ba7..97fb1f56b7 100644 --- a/submodules/PasscodeUI/Sources/PasscodeEntryInputFieldNode.swift +++ b/submodules/PasscodeUI/Sources/PasscodeEntryInputFieldNode.swift @@ -185,6 +185,7 @@ final class PasscodeEntryInputFieldNode: ASDisplayNode, UITextFieldDelegate { self.textFieldNode.textField.tintColor = self.accentColor self.textFieldNode.textField.keyboardAppearance = self.keyboardAppearance self.textFieldNode.textField.keyboardType = self.fieldType.keyboardType + self.textFieldNode.textField.tintColor = self.accentColor if self.useCustomNumpad { switch self.fieldType { diff --git a/submodules/PassportUI/Sources/Form/FormControllerTextInputItem.swift b/submodules/PassportUI/Sources/Form/FormControllerTextInputItem.swift index a94b686695..c9b9cbc0af 100644 --- a/submodules/PassportUI/Sources/Form/FormControllerTextInputItem.swift +++ b/submodules/PassportUI/Sources/Form/FormControllerTextInputItem.swift @@ -144,6 +144,7 @@ final class FormControllerTextInputItemNode: FormBlockItemNode Void = { [weak self] requestedData in - guard let strongSelf = self, let state = strongSelf.state, let verificationState = state.verificationState, case let .verified(context) = verificationState, let formData = form.formData, let validLayout = strongSelf.validLayout?.0 else { + guard let strongSelf = self, let state = strongSelf.state, let verificationState = state.verificationState, case .verified = verificationState, let formData = form.formData, let validLayout = strongSelf.validLayout?.0 else { return } diff --git a/submodules/PassportUI/Sources/SecureIdAuthPasswordOptionContentNode.swift b/submodules/PassportUI/Sources/SecureIdAuthPasswordOptionContentNode.swift index 82d7d57159..408341b540 100644 --- a/submodules/PassportUI/Sources/SecureIdAuthPasswordOptionContentNode.swift +++ b/submodules/PassportUI/Sources/SecureIdAuthPasswordOptionContentNode.swift @@ -60,6 +60,7 @@ final class SecureIdAuthPasswordOptionContentNode: ASDisplayNode, SecureIdAuthCo self.inputField.textField.textColor = theme.list.freeInputField.primaryColor self.inputField.textField.attributedPlaceholder = NSAttributedString(string: hint.isEmpty ? strings.LoginPassword_PasswordPlaceholder : hint, font: passwordFont, textColor: theme.list.freeInputField.placeholderColor) self.inputField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.inputField.textField.tintColor = theme.list.itemAccentColor self.buttonNode = HighlightableButtonNode() diff --git a/submodules/PassportUI/Sources/SecureIdDocumentFormControllerNode.swift b/submodules/PassportUI/Sources/SecureIdDocumentFormControllerNode.swift index 51b0071ed7..6ce48f0ca8 100644 --- a/submodules/PassportUI/Sources/SecureIdDocumentFormControllerNode.swift +++ b/submodules/PassportUI/Sources/SecureIdDocumentFormControllerNode.swift @@ -2953,7 +2953,7 @@ final class SecureIdDocumentFormControllerNode: FormControllerNode thumbnailContextSize.width { - let additionalContextSize = thumbnailContextFittingSize - let additionalBlurContext = DrawingContext(size: additionalContextSize, scale: 1.0) - additionalBlurContext.withFlippedContext { c in - c.interpolationQuality = .default - if let image = thumbnailContext.generateImage()?.cgImage { - c.draw(image, in: CGRect(origin: CGPoint(), size: additionalContextSize)) - } + let initialThumbnailContextFittingSize = fittedSize.fitted(CGSize(width: 100.0, height: 100.0)) + + let thumbnailContextSize = thumbnailSize.aspectFitted(initialThumbnailContextFittingSize) + let thumbnailContext = DrawingContext(size: thumbnailContextSize, scale: 1.0) + thumbnailContext.withFlippedContext { c in + c.interpolationQuality = .none + c.draw(fullSizeImage, in: CGRect(origin: CGPoint(), size: thumbnailContextSize)) + } + imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) + + var thumbnailContextFittingSize = CGSize(width: floor(arguments.drawingSize.width * 0.5), height: floor(arguments.drawingSize.width * 0.5)) + if thumbnailContextFittingSize.width < 150.0 || thumbnailContextFittingSize.height < 150.0 { + thumbnailContextFittingSize = thumbnailContextFittingSize.aspectFilled(CGSize(width: 150.0, height: 150.0)) + } + + if thumbnailContextFittingSize.width > thumbnailContextSize.width { + let additionalContextSize = thumbnailContextFittingSize + let additionalBlurContext = DrawingContext(size: additionalContextSize, scale: 1.0) + additionalBlurContext.withFlippedContext { c in + c.interpolationQuality = .default + if let image = thumbnailContext.generateImage()?.cgImage { + c.draw(image, in: CGRect(origin: CGPoint(), size: additionalContextSize)) } - imageFastBlur(Int32(additionalContextSize.width), Int32(additionalContextSize.height), Int32(additionalBlurContext.bytesPerRow), additionalBlurContext.bytes) - sideBlurredImage = additionalBlurContext.generateImage() - } else { - sideBlurredImage = thumbnailContext.generateImage() } + imageFastBlur(Int32(additionalContextSize.width), Int32(additionalContextSize.height), Int32(additionalBlurContext.bytesPerRow), additionalBlurContext.bytes) + sideBlurredImage = additionalBlurContext.generateImage() } else { - let thumbnailContextSize = thumbnailSize.aspectFitted(CGSize(width: 74.0, height: 74.0)) - let thumbnailContext = DrawingContext(size: thumbnailContextSize, scale: 1.0) - thumbnailContext.withFlippedContext { c in - c.interpolationQuality = .none - c.draw(fullSizeImage, in: CGRect(origin: CGPoint(), size: thumbnailContextSize)) - } - imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) - imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) sideBlurredImage = thumbnailContext.generateImage() } @@ -1230,7 +1218,7 @@ public func chatSecretPhoto(account: Account, photoReference: ImageMediaReferenc } private func avatarGalleryThumbnailDatas(postbox: Postbox, representations: [ImageRepresentationWithReference], fullRepresentationSize: CGSize = CGSize(width: 1280.0, height: 1280.0), autoFetchFullSize: Bool = false) -> Signal, NoError> { - if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = imageRepresentationLargerThan(representations.map({ $0.representation }), size: fullRepresentationSize), let smallestIndex = representations.index(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.index(where: { $0.representation == largestRepresentation }) { + if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = imageRepresentationLargerThan(representations.map({ $0.representation }), size: fullRepresentationSize), let smallestIndex = representations.firstIndex(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.firstIndex(where: { $0.representation == largestRepresentation }) { let maybeFullSize = postbox.mediaBox.resourceData(largestRepresentation.resource) let signal = maybeFullSize @@ -1670,45 +1658,33 @@ public func internalMediaGridMessageVideo(postbox: Postbox, videoReference: File if let fullSizeImage = blurSourceImage { var sideBlurredImage: UIImage? let thumbnailSize = CGSize(width: fullSizeImage.width, height: fullSizeImage.height) - if true { - let initialThumbnailContextFittingSize = drawingSize.fitted(CGSize(width: 100.0, height: 100.0)) - - let thumbnailContextSize = thumbnailSize.aspectFitted(initialThumbnailContextFittingSize) - let thumbnailContext = DrawingContext(size: thumbnailContextSize, scale: 1.0) - thumbnailContext.withFlippedContext { c in - c.interpolationQuality = .none - c.draw(fullSizeImage, in: CGRect(origin: CGPoint(), size: thumbnailContextSize)) - } - imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) - - var thumbnailContextFittingSize = CGSize(width: floor(arguments.drawingSize.width * 0.5), height: floor(arguments.drawingSize.width * 0.5)) - if thumbnailContextFittingSize.width < 150.0 || thumbnailContextFittingSize.height < 150.0 { - thumbnailContextFittingSize = thumbnailContextFittingSize.aspectFilled(CGSize(width: 150.0, height: 150.0)) - } - - if thumbnailContextFittingSize.width > thumbnailContextSize.width { - let additionalContextSize = thumbnailContextFittingSize - let additionalBlurContext = DrawingContext(size: additionalContextSize, scale: 1.0) - additionalBlurContext.withFlippedContext { c in - c.interpolationQuality = .default - if let image = thumbnailContext.generateImage()?.cgImage { - c.draw(image, in: CGRect(origin: CGPoint(), size: additionalContextSize)) - } + let initialThumbnailContextFittingSize = drawingSize.fitted(CGSize(width: 100.0, height: 100.0)) + + let thumbnailContextSize = thumbnailSize.aspectFitted(initialThumbnailContextFittingSize) + let thumbnailContext = DrawingContext(size: thumbnailContextSize, scale: 1.0) + thumbnailContext.withFlippedContext { c in + c.interpolationQuality = .none + c.draw(fullSizeImage, in: CGRect(origin: CGPoint(), size: thumbnailContextSize)) + } + imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) + + var thumbnailContextFittingSize = CGSize(width: floor(arguments.drawingSize.width * 0.5), height: floor(arguments.drawingSize.width * 0.5)) + if thumbnailContextFittingSize.width < 150.0 || thumbnailContextFittingSize.height < 150.0 { + thumbnailContextFittingSize = thumbnailContextFittingSize.aspectFilled(CGSize(width: 150.0, height: 150.0)) + } + + if thumbnailContextFittingSize.width > thumbnailContextSize.width { + let additionalContextSize = thumbnailContextFittingSize + let additionalBlurContext = DrawingContext(size: additionalContextSize, scale: 1.0) + additionalBlurContext.withFlippedContext { c in + c.interpolationQuality = .default + if let image = thumbnailContext.generateImage()?.cgImage { + c.draw(image, in: CGRect(origin: CGPoint(), size: additionalContextSize)) } - imageFastBlur(Int32(additionalContextSize.width), Int32(additionalContextSize.height), Int32(additionalBlurContext.bytesPerRow), additionalBlurContext.bytes) - sideBlurredImage = additionalBlurContext.generateImage() - } else { - sideBlurredImage = thumbnailContext.generateImage() } + imageFastBlur(Int32(additionalContextSize.width), Int32(additionalContextSize.height), Int32(additionalBlurContext.bytesPerRow), additionalBlurContext.bytes) + sideBlurredImage = additionalBlurContext.generateImage() } else { - let thumbnailContextSize = thumbnailSize.aspectFitted(CGSize(width: 74.0, height: 74.0)) - let thumbnailContext = DrawingContext(size: thumbnailContextSize, scale: 1.0) - thumbnailContext.withFlippedContext { c in - c.interpolationQuality = .none - c.draw(fullSizeImage, in: CGRect(origin: CGPoint(), size: thumbnailContextSize)) - } - imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) - imageFastBlur(Int32(thumbnailContextSize.width), Int32(thumbnailContextSize.height), Int32(thumbnailContext.bytesPerRow), thumbnailContext.bytes) sideBlurredImage = thumbnailContext.generateImage() } @@ -2307,7 +2283,7 @@ public func instantPageImageFile(account: Account, fileReference: FileMediaRefer } private func avatarGalleryPhotoDatas(account: Account, fileReference: FileMediaReference? = nil, representations: [ImageRepresentationWithReference], autoFetchFullSize: Bool = false) -> Signal, NoError> { - if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.index(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.index(where: { $0.representation == largestRepresentation }) { + if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.firstIndex(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.firstIndex(where: { $0.representation == largestRepresentation }) { let maybeFullSize = account.postbox.mediaBox.resourceData(largestRepresentation.resource) diff --git a/submodules/Postbox/Postbox/ItemCollection.swift b/submodules/Postbox/Postbox/ItemCollection.swift index 947f2d53ec..c42322acc0 100644 --- a/submodules/Postbox/Postbox/ItemCollection.swift +++ b/submodules/Postbox/Postbox/ItemCollection.swift @@ -103,4 +103,5 @@ public protocol ItemCollectionItem: PostboxCoding { public enum ItemCollectionSearchQuery { case exact(ValueBoxKey) case matching([ValueBoxKey]) + case any([ValueBoxKey]) } diff --git a/submodules/Postbox/Postbox/ItemCollectionItemTable.swift b/submodules/Postbox/Postbox/ItemCollectionItemTable.swift index 402987a7f9..bd9852319c 100644 --- a/submodules/Postbox/Postbox/ItemCollectionItemTable.swift +++ b/submodules/Postbox/Postbox/ItemCollectionItemTable.swift @@ -229,6 +229,8 @@ final class ItemCollectionItemTable: Table { references = self.reverseIndexTable.exactReferences(namespace: ReverseIndexNamespace(namespace), token: token) case let .matching(tokens): references = Array(self.reverseIndexTable.matchingReferences(namespace: ReverseIndexNamespace(namespace), tokens: tokens)) + case let .any(tokens): + references = Array(self.reverseIndexTable.matchingReferences(namespace: ReverseIndexNamespace(namespace), tokens: tokens, union: true)) } var resultsByCollectionId: [ItemCollectionId: [(ItemCollectionItemIndex, ItemCollectionItem)]] = [:] for reference in references { diff --git a/submodules/Postbox/Postbox/MessageHistoryTable.swift b/submodules/Postbox/Postbox/MessageHistoryTable.swift index 701d92990a..ca5f4307e5 100644 --- a/submodules/Postbox/Postbox/MessageHistoryTable.swift +++ b/submodules/Postbox/Postbox/MessageHistoryTable.swift @@ -426,8 +426,8 @@ final class MessageHistoryTable: Table { self.processIndexOperations(peerId, operations: operations, processedOperationsByPeerId: &operationsByPeerId, updatedMedia: &updatedMedia, unsentMessageOperations: &unsentMessageOperations, updatedPeerReadStateOperations: &updatedPeerReadStateOperations, globalTagsOperations: &globalTagsOperations, pendingActionsOperations: &pendingActionsOperations, updatedMessageActionsSummaries: &updatedMessageActionsSummaries, updatedMessageTagSummaries: &updatedMessageTagSummaries, invalidateMessageTagSummaries: &invalidateMessageTagSummaries, localTagsOperations: &localTagsOperations) } - func clearHistory(peerId: PeerId, operationsByPeerId: inout [PeerId: [MessageHistoryOperation]], updatedMedia: inout [MediaId: Media?], unsentMessageOperations: inout [IntermediateMessageHistoryUnsentOperation], updatedPeerReadStateOperations: inout [PeerId: PeerReadStateSynchronizationOperation?], globalTagsOperations: inout [GlobalMessageHistoryTagsOperation], pendingActionsOperations: inout [PendingMessageActionsOperation], updatedMessageActionsSummaries: inout [PendingMessageActionsSummaryKey: Int32], updatedMessageTagSummaries: inout [MessageHistoryTagsSummaryKey: MessageHistoryTagNamespaceSummary], invalidateMessageTagSummaries: inout [InvalidatedMessageHistoryTagsSummaryEntryOperation], localTagsOperations: inout [IntermediateMessageHistoryLocalTagsOperation]) { - let indices = self.allMessageIndices(peerId: peerId) + func clearHistory(peerId: PeerId, namespaces: MessageIdNamespaces, operationsByPeerId: inout [PeerId: [MessageHistoryOperation]], updatedMedia: inout [MediaId: Media?], unsentMessageOperations: inout [IntermediateMessageHistoryUnsentOperation], updatedPeerReadStateOperations: inout [PeerId: PeerReadStateSynchronizationOperation?], globalTagsOperations: inout [GlobalMessageHistoryTagsOperation], pendingActionsOperations: inout [PendingMessageActionsOperation], updatedMessageActionsSummaries: inout [PendingMessageActionsSummaryKey: Int32], updatedMessageTagSummaries: inout [MessageHistoryTagsSummaryKey: MessageHistoryTagNamespaceSummary], invalidateMessageTagSummaries: inout [InvalidatedMessageHistoryTagsSummaryEntryOperation], localTagsOperations: inout [IntermediateMessageHistoryLocalTagsOperation]) { + let indices = self.allMessageIndices(peerId: peerId).filter { namespaces.contains($0.id.namespace) } self.removeMessages(indices.map { $0.id }, operationsByPeerId: &operationsByPeerId, updatedMedia: &updatedMedia, unsentMessageOperations: &unsentMessageOperations, updatedPeerReadStateOperations: &updatedPeerReadStateOperations, globalTagsOperations: &globalTagsOperations, pendingActionsOperations: &pendingActionsOperations, updatedMessageActionsSummaries: &updatedMessageActionsSummaries, updatedMessageTagSummaries: &updatedMessageTagSummaries, invalidateMessageTagSummaries: &invalidateMessageTagSummaries, localTagsOperations: &localTagsOperations) } diff --git a/submodules/Postbox/Postbox/Postbox.swift b/submodules/Postbox/Postbox/Postbox.swift index c7216d6498..653c023d84 100644 --- a/submodules/Postbox/Postbox/Postbox.swift +++ b/submodules/Postbox/Postbox/Postbox.swift @@ -86,9 +86,9 @@ public final class Transaction { self.postbox?.withAllMessages(peerId: peerId, namespace: namespace, f) } - public func clearHistory(_ peerId: PeerId) { + public func clearHistory(_ peerId: PeerId, namespaces: MessageIdNamespaces) { assert(!self.disposed) - self.postbox?.clearHistory(peerId) + self.postbox?.clearHistory(peerId, namespaces: namespaces) } public func removeAllMessagesWithAuthor(_ peerId: PeerId, authorId: PeerId, namespace: MessageId.Namespace) { @@ -1519,9 +1519,9 @@ public final class Postbox { } } - fileprivate func clearHistory(_ peerId: PeerId) { - self.messageHistoryTable.clearHistory(peerId: peerId, operationsByPeerId: &self.currentOperationsByPeerId, updatedMedia: &self.currentUpdatedMedia, unsentMessageOperations: ¤tUnsentOperations, updatedPeerReadStateOperations: &self.currentUpdatedSynchronizeReadStateOperations, globalTagsOperations: &self.currentGlobalTagsOperations, pendingActionsOperations: &self.currentPendingMessageActionsOperations, updatedMessageActionsSummaries: &self.currentUpdatedMessageActionsSummaries, updatedMessageTagSummaries: &self.currentUpdatedMessageTagSummaries, invalidateMessageTagSummaries: &self.currentInvalidateMessageTagSummaries, localTagsOperations: &self.currentLocalTagsOperations) - for namespace in self.messageHistoryHoleIndexTable.existingNamespaces(peerId: peerId, holeSpace: .everywhere) { + fileprivate func clearHistory(_ peerId: PeerId, namespaces: MessageIdNamespaces) { + self.messageHistoryTable.clearHistory(peerId: peerId, namespaces: namespaces, operationsByPeerId: &self.currentOperationsByPeerId, updatedMedia: &self.currentUpdatedMedia, unsentMessageOperations: ¤tUnsentOperations, updatedPeerReadStateOperations: &self.currentUpdatedSynchronizeReadStateOperations, globalTagsOperations: &self.currentGlobalTagsOperations, pendingActionsOperations: &self.currentPendingMessageActionsOperations, updatedMessageActionsSummaries: &self.currentUpdatedMessageActionsSummaries, updatedMessageTagSummaries: &self.currentUpdatedMessageTagSummaries, invalidateMessageTagSummaries: &self.currentInvalidateMessageTagSummaries, localTagsOperations: &self.currentLocalTagsOperations) + for namespace in self.messageHistoryHoleIndexTable.existingNamespaces(peerId: peerId, holeSpace: .everywhere) where namespaces.contains(namespace) { self.messageHistoryHoleIndexTable.remove(peerId: peerId, namespace: namespace, space: .everywhere, range: 1 ... Int32.max - 1, operations: &self.currentPeerHoleOperations) } } diff --git a/submodules/Postbox/Postbox/ReverseIndexReferenceTable.swift b/submodules/Postbox/Postbox/ReverseIndexReferenceTable.swift index b2991cf8ae..4e8b6f37a3 100644 --- a/submodules/Postbox/Postbox/ReverseIndexReferenceTable.swift +++ b/submodules/Postbox/Postbox/ReverseIndexReferenceTable.swift @@ -188,7 +188,7 @@ final class ReverseIndexReferenceTable: Table { } } - func matchingReferences(namespace: ReverseIndexNamespace, tokens: [ValueBoxKey]) -> Set { + func matchingReferences(namespace: ReverseIndexNamespace, tokens: [ValueBoxKey], union: Bool = false) -> Set { var references: Set? for token in tokens { if let references = references, references.isEmpty { @@ -208,7 +208,11 @@ final class ReverseIndexReferenceTable: Table { return true }, limit: 0) if let previousReferences = references { - references = previousReferences.intersection(currentReferences) + if union { + references = previousReferences.union(currentReferences) + } else { + references = previousReferences.intersection(currentReferences) + } } else { references = currentReferences } diff --git a/submodules/SearchBarNode/Sources/SearchBarNode.swift b/submodules/SearchBarNode/Sources/SearchBarNode.swift index 03ead7c44f..0ca4a86aec 100644 --- a/submodules/SearchBarNode/Sources/SearchBarNode.swift +++ b/submodules/SearchBarNode/Sources/SearchBarNode.swift @@ -398,6 +398,7 @@ public class SearchBarNode: ASDisplayNode, UITextFieldDelegate { self.clearButton.setImage(generateClearIcon(color: theme.inputClear), for: []) self.iconNode.image = generateLoupeIcon(color: theme.inputIcon) self.textField.keyboardAppearance = theme.keyboard.keyboardAppearance + self.textField.tintColor = theme.accent if let activityIndicator = self.activityIndicator { activityIndicator.type = .custom(theme.inputIcon, 13.0, 1.0, false) diff --git a/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift b/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift index 20018cba42..490fd4fc26 100644 --- a/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift +++ b/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift @@ -128,8 +128,10 @@ final class ChangePhoneNumberControllerNode: ASDisplayNode { self.phoneInputNode = PhoneInputNode(fontSize: 17.0) self.phoneInputNode.countryCodeField.textField.textColor = self.presentationData.theme.list.itemPrimaryTextColor self.phoneInputNode.countryCodeField.textField.keyboardAppearance = self.presentationData.theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.phoneInputNode.countryCodeField.textField.tintColor = self.presentationData.theme.list.itemAccentColor self.phoneInputNode.numberField.textField.textColor = self.presentationData.theme.list.itemPrimaryTextColor self.phoneInputNode.numberField.textField.keyboardAppearance = self.presentationData.theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.phoneInputNode.numberField.textField.tintColor = self.presentationData.theme.list.itemAccentColor super.init() diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift index 05d4320b44..52490f215b 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyListSettingsController.swift @@ -340,7 +340,7 @@ public func proxySettingsController(accountManager: AccountManager, postbox: Pos let _ = updateProxySettingsInteractively(accountManager: accountManager, { current in var current = current if current.activeServer != server { - if let _ = current.servers.index(of: server) { + if let _ = current.servers.firstIndex(of: server) { current.activeServer = server current.enabled = true } @@ -352,7 +352,7 @@ public func proxySettingsController(accountManager: AccountManager, postbox: Pos }, removeServer: { server in let _ = updateProxySettingsInteractively(accountManager: accountManager, { current in var current = current - if let index = current.servers.index(of: server) { + if let index = current.servers.firstIndex(of: server) { current.servers.remove(at: index) if current.activeServer == server { current.activeServer = nil @@ -462,7 +462,7 @@ public func proxySettingsController(accountManager: AccountManager, postbox: Pos let _ = updateProxySettingsInteractively(accountManager: accountManager, { current in var current = current - if let index = current.servers.index(of: fromServer) { + if let index = current.servers.firstIndex(of: fromServer) { current.servers.remove(at: index) } if let referenceServer = referenceServer { diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift index c6e2c85ee9..1692b8b0cc 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift @@ -384,7 +384,7 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode { updateProxySettingsInteractively(transaction: transaction, { settings in currentSettings = settings var settings = settings - if let index = settings.servers.index(of: proxyServerSettings) { + if let index = settings.servers.firstIndex(of: proxyServerSettings) { settings.servers[index] = proxyServerSettings settings.activeServer = proxyServerSettings } else { diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift index 9e654a1fd8..6b2c64fb8f 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerSettingsController.swift @@ -343,7 +343,7 @@ func proxyServerSettingsController(theme: PresentationTheme, strings: Presentati let _ = (updateProxySettingsInteractively(accountManager: accountManager, { settings in var settings = settings if let currentSettings = currentSettings { - if let index = settings.servers.index(of: currentSettings) { + if let index = settings.servers.firstIndex(of: currentSettings) { settings.servers[index] = proxyServerSettings if settings.activeServer == currentSettings { settings.activeServer = proxyServerSettings @@ -375,7 +375,6 @@ func proxyServerSettingsController(theme: PresentationTheme, strings: Presentati dismissImpl = { [weak controller] in let _ = controller?.dismiss() } - shareImpl = { [weak controller] in let state = stateValue.with { $0 } guard let server = proxyServerSettings(with: state), let strongController = controller else { @@ -383,6 +382,7 @@ func proxyServerSettingsController(theme: PresentationTheme, strings: Presentati } let link = shareLink(for: server) + controller?.view.endEditing(true) if #available(iOSApplicationExtension 9.0, iOS 9.0, *) { let controller = ShareProxyServerActionSheetController(theme: theme, strings: strings, updatedPresentationData: updatedPresentationData, link: link) presentImpl?(controller, nil) diff --git a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift index 88223e33df..3698fc572e 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/RecentSessionsController.swift @@ -344,7 +344,7 @@ private func recentSessionsControllerEntries(presentationData: PresentationData, if !sessionsState.sessions.isEmpty { var existingSessionIds = Set() entries.append(.currentSessionHeader(presentationData.theme, presentationData.strings.AuthSessions_CurrentSession)) - if let index = sessionsState.sessions.index(where: { $0.hash == 0 }) { + if let index = sessionsState.sessions.firstIndex(where: { $0.hash == 0 }) { existingSessionIds.insert(sessionsState.sessions[index].hash) entries.append(.currentSession(presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, sessionsState.sessions[index])) } diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperColorPanelNode.swift b/submodules/SettingsUI/Sources/Themes/WallpaperColorPanelNode.swift index 5e6f5e0ec5..4ae912a779 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperColorPanelNode.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperColorPanelNode.swift @@ -112,6 +112,7 @@ final class WallpaperColorPanelNode: ASDisplayNode, UITextFieldDelegate { self.textFieldNode.textField.delegate = self self.textFieldNode.textField.addTarget(self, action: #selector(self.textFieldTextChanged(_:)), for: .editingChanged) self.textFieldNode.hitTestSlop = UIEdgeInsets(top: -5.0, left: -5.0, bottom: -5.0, right: -5.0) + self.textFieldNode.textField.tintColor = self.theme.list.itemAccentColor } func updateTheme(_ theme: PresentationTheme) { @@ -123,6 +124,7 @@ final class WallpaperColorPanelNode: ASDisplayNode, UITextFieldDelegate { self.textFieldNode.textField.textColor = self.theme.chat.inputPanel.inputTextColor self.textFieldNode.textField.keyboardAppearance = self.theme.chat.inputPanel.keyboardColor.keyboardAppearance + self.textFieldNode.textField.tintColor = self.theme.list.itemAccentColor } private func setColor(_ color: UIColor, updatePicker: Bool = true, ended: Bool = true) { diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift index 0e37ac7eda..4b3e508522 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryController.swift @@ -179,7 +179,7 @@ public class WallpaperGalleryController: ViewController { switch source { case let .list(wallpapers, central, type): entries = wallpapers.map { .wallpaper($0, nil) } - centralEntryIndex = wallpapers.index(of: central)! + centralEntryIndex = wallpapers.firstIndex(of: central)! if case let .wallpapers(wallpaperOptions) = type, let options = wallpaperOptions { self.initialOptions = options diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift index 4ee75d07a7..ff9ce3907d 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift @@ -267,7 +267,7 @@ final class WallpaperGalleryItemNode: GalleryItemNode { } } return - } else if let offset = self.validOffset, self.arguments.colorPreview && fabs(offset) > 0.0 { + } else if let offset = self.validOffset, self.arguments.colorPreview && abs(offset) > 0.0 { return } else { @@ -314,7 +314,7 @@ final class WallpaperGalleryItemNode: GalleryItemNode { let convertedRepresentations: [ImageRepresentationWithReference] = representations.map({ ImageRepresentationWithReference(representation: $0, reference: .wallpaper(resource: $0.resource)) }) signal = wallpaperImage(account: context.account, accountManager: context.sharedContext.accountManager, representations: convertedRepresentations, alwaysShowThumbnailFirst: true, autoFetchFullSize: false) - if let largestIndex = convertedRepresentations.index(where: { $0.representation == largestSize }) { + if let largestIndex = convertedRepresentations.firstIndex(where: { $0.representation == largestSize }) { fetchSignal = fetchedMediaResource(mediaBox: context.account.postbox.mediaBox, reference: convertedRepresentations[largestIndex].reference) } else { fetchSignal = .complete() diff --git a/submodules/ShareController/Sources/ShareInputFieldNode.swift b/submodules/ShareController/Sources/ShareInputFieldNode.swift index 9fe17aea07..0bda739e24 100644 --- a/submodules/ShareController/Sources/ShareInputFieldNode.swift +++ b/submodules/ShareController/Sources/ShareInputFieldNode.swift @@ -13,13 +13,15 @@ final class ShareInputFieldNodeTheme: Equatable { let textColor: UIColor let placeholderColor: UIColor let clearButtonColor: UIColor + let accentColor: UIColor let keyboard: PresentationThemeKeyboardColor - public init(backgroundColor: UIColor, textColor: UIColor, placeholderColor: UIColor, clearButtonColor: UIColor, keyboard: PresentationThemeKeyboardColor) { + public init(backgroundColor: UIColor, textColor: UIColor, placeholderColor: UIColor, clearButtonColor: UIColor, accentColor: UIColor, keyboard: PresentationThemeKeyboardColor) { self.backgroundColor = backgroundColor self.textColor = textColor self.placeholderColor = placeholderColor self.clearButtonColor = clearButtonColor + self.accentColor = accentColor self.keyboard = keyboard } @@ -36,6 +38,9 @@ final class ShareInputFieldNodeTheme: Equatable { if lhs.clearButtonColor != rhs.clearButtonColor { return false } + if lhs.accentColor != rhs.accentColor { + return false + } if lhs.keyboard != rhs.keyboard { return false } @@ -45,7 +50,7 @@ final class ShareInputFieldNodeTheme: Equatable { extension ShareInputFieldNodeTheme { convenience init(presentationTheme theme: PresentationTheme) { - self.init(backgroundColor: theme.actionSheet.inputBackgroundColor, textColor: theme.actionSheet.inputTextColor, placeholderColor: theme.actionSheet.inputPlaceholderColor, clearButtonColor: theme.actionSheet.inputClearButtonColor, keyboard: theme.chatList.searchBarKeyboardColor) + self.init(backgroundColor: theme.actionSheet.inputBackgroundColor, textColor: theme.actionSheet.inputTextColor, placeholderColor: theme.actionSheet.inputPlaceholderColor, clearButtonColor: theme.actionSheet.inputClearButtonColor, accentColor: theme.actionSheet.controlAccentColor, keyboard: theme.chatList.searchBarKeyboardColor) } } @@ -95,6 +100,7 @@ final class ShareInputFieldNode: ASDisplayNode, ASEditableTextNodeDelegate { self.textInputNode.hitTestSlop = UIEdgeInsets(top: -5.0, left: -5.0, bottom: -5.0, right: -5.0) self.textInputNode.textContainerInset = UIEdgeInsets(top: self.inputInsets.top, left: 0.0, bottom: self.inputInsets.bottom, right: 0.0) self.textInputNode.keyboardAppearance = theme.keyboard.keyboardAppearance + self.textInputNode.tintColor = theme.accentColor self.placeholderNode = ASTextNode() self.placeholderNode.isUserInteractionEnabled = false diff --git a/submodules/ShareController/Sources/SharePeersContainerNode.swift b/submodules/ShareController/Sources/SharePeersContainerNode.swift index 14bc1bff93..5b933e3116 100644 --- a/submodules/ShareController/Sources/SharePeersContainerNode.swift +++ b/submodules/ShareController/Sources/SharePeersContainerNode.swift @@ -287,7 +287,7 @@ final class SharePeersContainerNode: ASDisplayNode, ShareContentContainerNode { var scrollToItem: GridNodeScrollToItem? if let ensurePeerVisibleOnLayout = self.ensurePeerVisibleOnLayout { self.ensurePeerVisibleOnLayout = nil - if let index = self.entries.index(where: { $0.peer.peerId == ensurePeerVisibleOnLayout }) { + if let index = self.entries.firstIndex(where: { $0.peer.peerId == ensurePeerVisibleOnLayout }) { scrollToItem = GridNodeScrollToItem(index: index, position: .visible, transition: transition, directionHint: .up, adjustForSection: false) } } diff --git a/submodules/ShareController/Sources/ShareSearchBarNode.swift b/submodules/ShareController/Sources/ShareSearchBarNode.swift index 0101c5b2c1..37b9294387 100644 --- a/submodules/ShareController/Sources/ShareSearchBarNode.swift +++ b/submodules/ShareController/Sources/ShareSearchBarNode.swift @@ -42,13 +42,14 @@ final class ShareSearchBarNode: ASDisplayNode, UITextFieldDelegate { self.textInputNode.fixOffset = false let textColor: UIColor = theme.actionSheet.inputTextColor let keyboardAppearance: UIKeyboardAppearance = UIKeyboardAppearance.default - textInputNode.textField.font = Font.regular(16.0) - textInputNode.textField.textColor = textColor - textInputNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(16.0), NSAttributedString.Key.foregroundColor: textColor] - textInputNode.hitTestSlop = UIEdgeInsets(top: -5.0, left: -5.0, bottom: -5.0, right: -5.0) - textInputNode.textField.keyboardAppearance = keyboardAppearance - textInputNode.textField.attributedPlaceholder = NSAttributedString(string: placeholder, font: Font.regular(16.0), textColor: theme.actionSheet.inputPlaceholderColor) - textInputNode.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textInputNode.textField.font = Font.regular(16.0) + self.textInputNode.textField.textColor = textColor + self.textInputNode.textField.typingAttributes = [NSAttributedString.Key.font: Font.regular(16.0), NSAttributedString.Key.foregroundColor: textColor] + self.textInputNode.hitTestSlop = UIEdgeInsets(top: -5.0, left: -5.0, bottom: -5.0, right: -5.0) + self.textInputNode.textField.keyboardAppearance = keyboardAppearance + self.textInputNode.textField.attributedPlaceholder = NSAttributedString(string: placeholder, font: Font.regular(16.0), textColor: theme.actionSheet.inputPlaceholderColor) + self.textInputNode.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textInputNode.textField.tintColor = theme.actionSheet.controlAccentColor super.init() diff --git a/submodules/ShareController/Sources/ShareSearchContainerNode.swift b/submodules/ShareController/Sources/ShareSearchContainerNode.swift index 4346e68ea5..2b9935253a 100644 --- a/submodules/ShareController/Sources/ShareSearchContainerNode.swift +++ b/submodules/ShareController/Sources/ShareSearchContainerNode.swift @@ -71,7 +71,7 @@ private enum ShareSearchRecentEntry: Comparable, Identifiable { return false } case let .peer(lhsIndex, lhsTheme, lhsPeer, lhsAssociatedPeer, lhsPresence, lhsStrings): - if case let .peer(rhsIndex, rhsTheme, rhsPeer, rhsAssociatedPeer, rhsPresence, rhsStrings) = rhs, lhsPeer.isEqual(rhsPeer) && arePeersEqual(lhsAssociatedPeer, rhsAssociatedPeer) && lhsIndex == rhsIndex && lhsStrings === rhsStrings && lhsTheme === rhsTheme { + if case let .peer(rhsIndex, rhsTheme, rhsPeer, rhsAssociatedPeer, rhsPresence, rhsStrings) = rhs, lhsPeer.isEqual(rhsPeer) && arePeersEqual(lhsAssociatedPeer, rhsAssociatedPeer) && lhsIndex == rhsIndex && lhsStrings === rhsStrings && lhsTheme === rhsTheme && arePeerPresencesEqual(lhsPresence, rhsPresence) { return true } else { return false @@ -436,7 +436,7 @@ final class ShareSearchContainerNode: ASDisplayNode, ShareContentContainerNode { var scrollToItem: GridNodeScrollToItem? if !self.contentGridNode.isHidden, let ensurePeerVisibleOnLayout = self.ensurePeerVisibleOnLayout { self.ensurePeerVisibleOnLayout = nil - if let index = self.entries.index(where: { $0.peer.peerId == ensurePeerVisibleOnLayout }) { + if let index = self.entries.firstIndex(where: { $0.peer.peerId == ensurePeerVisibleOnLayout }) { scrollToItem = GridNodeScrollToItem(index: index, position: .visible, transition: transition, directionHint: .up, adjustForSection: false) } } @@ -444,7 +444,7 @@ final class ShareSearchContainerNode: ASDisplayNode, ShareContentContainerNode { var scrollToRecentItem: GridNodeScrollToItem? if !self.recentGridNode.isHidden, let ensurePeerVisibleOnLayout = self.ensurePeerVisibleOnLayout { self.ensurePeerVisibleOnLayout = nil - if let index = self.recentEntries.index(where: { + if let index = self.recentEntries.firstIndex(where: { switch $0 { case .topPeers: return false diff --git a/submodules/SolidRoundedButtonNode/Sources/SolidRoundedButtonNode.swift b/submodules/SolidRoundedButtonNode/Sources/SolidRoundedButtonNode.swift index fc6f852281..e6781913dd 100644 --- a/submodules/SolidRoundedButtonNode/Sources/SolidRoundedButtonNode.swift +++ b/submodules/SolidRoundedButtonNode/Sources/SolidRoundedButtonNode.swift @@ -71,9 +71,12 @@ public final class SolidRoundedButtonNode: ASDisplayNode { } public func updateTheme(_ theme: PresentationTheme) { + guard theme !== self.theme else { + return + } self.theme = theme - self.buttonBackgroundNode.image = generateStretchableFilledCircleImage(radius: cornerRadius, color: theme.list.itemCheckColors.fillColor) + self.buttonBackgroundNode.image = generateStretchableFilledCircleImage(radius: self.buttonCornerRadius, color: theme.list.itemCheckColors.fillColor) self.buttonGlossNode.color = theme.list.itemCheckColors.foregroundColor self.labelNode.attributedText = NSAttributedString(string: self.title ?? "", font: Font.medium(17.0), textColor: theme.list.itemCheckColors.foregroundColor) } diff --git a/submodules/StickerPackPreviewUI/Sources/StickerPackPreviewGridItem.swift b/submodules/StickerPackPreviewUI/Sources/StickerPackPreviewGridItem.swift index cab64f5a93..7aabf8e95b 100644 --- a/submodules/StickerPackPreviewUI/Sources/StickerPackPreviewGridItem.swift +++ b/submodules/StickerPackPreviewUI/Sources/StickerPackPreviewGridItem.swift @@ -81,7 +81,7 @@ final class StickerPackPreviewGridItemNode: GridItemNode { } deinit { - stickerFetchedDisposable.dispose() + self.stickerFetchedDisposable.dispose() } override func didLoad() { diff --git a/submodules/TelegramCore/TelegramCore/DeleteMessages.swift b/submodules/TelegramCore/TelegramCore/DeleteMessages.swift index 07fcdbdd46..c7baa9356e 100644 --- a/submodules/TelegramCore/TelegramCore/DeleteMessages.swift +++ b/submodules/TelegramCore/TelegramCore/DeleteMessages.swift @@ -29,12 +29,12 @@ public func deleteMessages(transaction: Transaction, mediaBox: MediaBox, ids: [M transaction.deleteMessages(ids) } -public func clearHistory(transaction: Transaction, mediaBox: MediaBox, peerId: PeerId) { +public func clearHistory(transaction: Transaction, mediaBox: MediaBox, peerId: PeerId, namespaces: MessageIdNamespaces) { if peerId.namespace == Namespaces.Peer.SecretChat { transaction.withAllMessages(peerId: peerId, { message in removeMessageMedia(message: message, mediaBox: mediaBox) return true }) } - transaction.clearHistory(peerId) + transaction.clearHistory(peerId, namespaces: namespaces) } diff --git a/submodules/TelegramCore/TelegramCore/DeleteMessagesInteractively.swift b/submodules/TelegramCore/TelegramCore/DeleteMessagesInteractively.swift index 6ddc2999b4..57c7e4d65f 100644 --- a/submodules/TelegramCore/TelegramCore/DeleteMessagesInteractively.swift +++ b/submodules/TelegramCore/TelegramCore/DeleteMessagesInteractively.swift @@ -90,16 +90,18 @@ public func clearHistoryInteractively(postbox: Postbox, peerId: PeerId, type: In return postbox.transaction { transaction -> Void in if peerId.namespace == Namespaces.Peer.CloudUser || peerId.namespace == Namespaces.Peer.CloudGroup || peerId.namespace == Namespaces.Peer.CloudChannel { cloudChatAddClearHistoryOperation(transaction: transaction, peerId: peerId, explicitTopMessageId: nil, type: CloudChatClearHistoryType(type)) - if type != .scheduledMessages { + if type == .scheduledMessages { + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peerId, namespaces: .just(Namespaces.Message.allScheduled)) + } else { var topIndex: MessageIndex? if let topMessageId = transaction.getTopPeerMessageId(peerId: peerId, namespace: Namespaces.Message.Cloud), let topMessage = transaction.getMessage(topMessageId) { topIndex = topMessage.index } - clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peerId, namespaces: .not(Namespaces.Message.allScheduled)) if let cachedData = transaction.getPeerCachedData(peerId: peerId) as? CachedChannelData, let migrationReference = cachedData.migrationReference { cloudChatAddClearHistoryOperation(transaction: transaction, peerId: migrationReference.maxMessageId.peerId, explicitTopMessageId: MessageId(peerId: migrationReference.maxMessageId.peerId, namespace: migrationReference.maxMessageId.namespace, id: migrationReference.maxMessageId.id + 1), type: CloudChatClearHistoryType(type)) - clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: migrationReference.maxMessageId.peerId) + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: migrationReference.maxMessageId.peerId, namespaces: .all) } if let topIndex = topIndex { if peerId.namespace == Namespaces.Peer.CloudUser { @@ -110,7 +112,7 @@ public func clearHistoryInteractively(postbox: Postbox, peerId: PeerId, type: In } } } else if peerId.namespace == Namespaces.Peer.SecretChat { - clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peerId, namespaces: .all) if let state = transaction.getPeerChatState(peerId) as? SecretChatState { var layer: SecretChatLayer? diff --git a/submodules/TelegramCore/TelegramCore/ManagedCloudChatRemoveMessagesOperations.swift b/submodules/TelegramCore/TelegramCore/ManagedCloudChatRemoveMessagesOperations.swift index 65e252cfb9..a3a49414c3 100644 --- a/submodules/TelegramCore/TelegramCore/ManagedCloudChatRemoveMessagesOperations.swift +++ b/submodules/TelegramCore/TelegramCore/ManagedCloudChatRemoveMessagesOperations.swift @@ -309,7 +309,7 @@ private func removeChat(transaction: Transaction, postbox: Postbox, network: Net |> then(deleteUser) |> then(reportSignal) |> then(postbox.transaction { transaction -> Void in - clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peer.id) + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peer.id, namespaces: .all) }) } else if peer.id.namespace == Namespaces.Peer.CloudUser { if let inputPeer = apiInputPeer(peer) { @@ -328,7 +328,7 @@ private func removeChat(transaction: Transaction, postbox: Postbox, network: Net return requestClearHistory(postbox: postbox, network: network, stateManager: stateManager, inputPeer: inputPeer, maxId: operation.topMessageId?.id ?? Int32.max - 1, justClear: false, type: operation.deleteGloballyIfPossible ? .forEveryone : .forLocalPeer) |> then(reportSignal) |> then(postbox.transaction { transaction -> Void in - clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peer.id) + clearHistory(transaction: transaction, mediaBox: postbox.mediaBox, peerId: peer.id, namespaces: .not(Namespaces.Message.allScheduled)) }) } else { return .complete() diff --git a/submodules/TelegramCore/TelegramCore/ProcessSecretChatIncomingDecryptedOperations.swift b/submodules/TelegramCore/TelegramCore/ProcessSecretChatIncomingDecryptedOperations.swift index ebbc7936db..7f8d13e396 100644 --- a/submodules/TelegramCore/TelegramCore/ProcessSecretChatIncomingDecryptedOperations.swift +++ b/submodules/TelegramCore/TelegramCore/ProcessSecretChatIncomingDecryptedOperations.swift @@ -282,7 +282,7 @@ func processSecretChatIncomingDecryptedOperations(mediaBox: MediaBox, transactio deleteMessages(transaction: transaction, mediaBox: mediaBox, ids: filteredMessageIds) } case .clearHistory: - clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId, namespaces: .all) case let .markMessagesContentAsConsumed(globallyUniqueIds): var messageIds: [MessageId] = [] for id in globallyUniqueIds { diff --git a/submodules/TelegramCore/TelegramCore/RemovePeerChat.swift b/submodules/TelegramCore/TelegramCore/RemovePeerChat.swift index fcfd0c524c..d0425ea25a 100644 --- a/submodules/TelegramCore/TelegramCore/RemovePeerChat.swift +++ b/submodules/TelegramCore/TelegramCore/RemovePeerChat.swift @@ -49,17 +49,17 @@ public func removePeerChat(account: Account, transaction: Transaction, mediaBox: } } } - clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId, namespaces: .all) transaction.updatePeerChatListInclusion(peerId, inclusion: .notIncluded) transaction.removeOrderedItemListItem(collectionId: Namespaces.OrderedItemList.RecentlySearchedPeerIds, itemId: RecentPeerItemId(peerId).rawValue) } else { cloudChatAddRemoveChatOperation(transaction: transaction, peerId: peerId, reportChatSpam: reportChatSpam, deleteGloballyIfPossible: deleteGloballyIfPossible) if peerId.namespace == Namespaces.Peer.CloudUser { transaction.updatePeerChatListInclusion(peerId, inclusion: .notIncluded) - clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId, namespaces: .all) } else if peerId.namespace == Namespaces.Peer.CloudGroup { transaction.updatePeerChatListInclusion(peerId, inclusion: .notIncluded) - clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId) + clearHistory(transaction: transaction, mediaBox: mediaBox, peerId: peerId, namespaces: .all) } else { transaction.updatePeerChatListInclusion(peerId, inclusion: .notIncluded) } diff --git a/submodules/TelegramCore/TelegramCore/RequestEditMessage.swift b/submodules/TelegramCore/TelegramCore/RequestEditMessage.swift index 5061a35ea5..e929d7f5ae 100644 --- a/submodules/TelegramCore/TelegramCore/RequestEditMessage.swift +++ b/submodules/TelegramCore/TelegramCore/RequestEditMessage.swift @@ -106,7 +106,11 @@ private func requestEditMessageInternal(account: Account, messageId: MessageId, case _ as TelegramMediaImage, _ as TelegramMediaFile: break default: - return (nil, nil, SimpleDictionary()) + if let _ = scheduleTime { + break + } else { + return (nil, nil, SimpleDictionary()) + } } } } diff --git a/submodules/TelegramCore/TelegramCore/SearchStickers.swift b/submodules/TelegramCore/TelegramCore/SearchStickers.swift index 42406113dd..d6a19fa05f 100644 --- a/submodules/TelegramCore/TelegramCore/SearchStickers.swift +++ b/submodules/TelegramCore/TelegramCore/SearchStickers.swift @@ -132,7 +132,7 @@ public func searchStickers(account: Account, query: String, scope: SearchSticker var searchQuery: ItemCollectionSearchQuery = .exact(ValueBoxKey(query)) if query == "\u{2764}" { - searchQuery = .matching([ValueBoxKey("\u{2764}"), ValueBoxKey("\u{2764}\u{fe0f}")]) + searchQuery = .any([ValueBoxKey("\u{2764}"), ValueBoxKey("\u{2764}\u{FE0F}")]) } var installedItems: [FoundStickerItem] = [] diff --git a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift index f4e050c63c..3aeaff3705 100644 --- a/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift +++ b/submodules/TelegramPresentationData/Sources/ComponentsThemes.swift @@ -3,50 +3,50 @@ import UIKit import Display public extension TabBarControllerTheme { - convenience public init(rootControllerTheme: PresentationTheme) { + convenience init(rootControllerTheme: PresentationTheme) { let theme = rootControllerTheme.rootController.tabBar self.init(backgroundColor: rootControllerTheme.list.plainBackgroundColor, tabBarBackgroundColor: theme.backgroundColor, tabBarSeparatorColor: theme.separatorColor, tabBarTextColor: theme.textColor, tabBarSelectedTextColor: theme.selectedIconColor, tabBarBadgeBackgroundColor: theme.badgeBackgroundColor, tabBarBadgeStrokeColor: theme.badgeStrokeColor, tabBarBadgeTextColor: theme.badgeTextColor) } } public extension NavigationBarTheme { - convenience public init(rootControllerTheme: PresentationTheme) { + convenience init(rootControllerTheme: PresentationTheme) { let theme = rootControllerTheme.rootController.navigationBar self.init(buttonColor: theme.buttonColor, disabledButtonColor: theme.disabledButtonColor, primaryTextColor: theme.primaryTextColor, backgroundColor: theme.backgroundColor, separatorColor: theme.separatorColor, badgeBackgroundColor: theme.badgeBackgroundColor, badgeStrokeColor: theme.badgeStrokeColor, badgeTextColor: theme.badgeTextColor) } } public extension NavigationBarStrings { - convenience public init(presentationStrings: PresentationStrings) { + convenience init(presentationStrings: PresentationStrings) { self.init(back: presentationStrings.Common_Back, close: presentationStrings.Common_Close) } } public extension NavigationBarPresentationData { - convenience public init(presentationData: PresentationData) { + convenience init(presentationData: PresentationData) { self.init(theme: NavigationBarTheme(rootControllerTheme: presentationData.theme), strings: NavigationBarStrings(presentationStrings: presentationData.strings)) } - convenience public init(presentationTheme: PresentationTheme, presentationStrings: PresentationStrings) { + convenience init(presentationTheme: PresentationTheme, presentationStrings: PresentationStrings) { self.init(theme: NavigationBarTheme(rootControllerTheme: presentationTheme), strings: NavigationBarStrings(presentationStrings: presentationStrings)) } } public extension ActionSheetControllerTheme { - convenience public init(presentationTheme: PresentationTheme) { + convenience init(presentationTheme: PresentationTheme) { let actionSheet = presentationTheme.actionSheet self.init(dimColor: actionSheet.dimColor, backgroundType: actionSheet.backgroundType == .light ? .light : .dark, itemBackgroundColor: actionSheet.itemBackgroundColor, itemHighlightedBackgroundColor: actionSheet.itemHighlightedBackgroundColor, standardActionTextColor: actionSheet.standardActionTextColor, destructiveActionTextColor: actionSheet.destructiveActionTextColor, disabledActionTextColor: actionSheet.disabledActionTextColor, primaryTextColor: actionSheet.primaryTextColor, secondaryTextColor: actionSheet.secondaryTextColor, controlAccentColor: actionSheet.controlAccentColor, controlColor: presentationTheme.list.disclosureArrowColor, switchFrameColor: presentationTheme.list.itemSwitchColors.frameColor, switchContentColor: presentationTheme.list.itemSwitchColors.contentColor, switchHandleColor: presentationTheme.list.itemSwitchColors.handleColor) } } public extension ActionSheetController { - convenience public init(presentationTheme: PresentationTheme) { + convenience init(presentationTheme: PresentationTheme) { self.init(theme: ActionSheetControllerTheme(presentationTheme: presentationTheme)) } } public extension AlertControllerTheme { - convenience public init(presentationTheme: PresentationTheme) { + convenience init(presentationTheme: PresentationTheme) { let actionSheet = presentationTheme.actionSheet self.init(backgroundType: actionSheet.backgroundType == .light ? .light : .dark, backgroundColor: actionSheet.itemBackgroundColor, separatorColor: actionSheet.itemHighlightedBackgroundColor, highlightedItemColor: actionSheet.itemHighlightedBackgroundColor, primaryColor: actionSheet.primaryTextColor, secondaryColor: actionSheet.secondaryTextColor, accentColor: actionSheet.controlAccentColor, destructiveColor: actionSheet.destructiveActionTextColor, disabledColor: actionSheet.disabledActionTextColor) } diff --git a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift index 9085ebd739..db5367eb7f 100644 --- a/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift +++ b/submodules/TelegramPresentationData/Sources/DefaultDayPresentationTheme.swift @@ -25,7 +25,7 @@ private func makeDefaultDayPresentationTheme(accentColor: UIColor, serviceBackgr outgoingBubbleFillColor = accentColor let hsv = accentColor.hsv - accentColor = UIColor(hue: hsv.0, saturation: hsv.1 * 1.1, brightness: min(hsv.2, 0.77), alpha: 1.0) + accentColor = UIColor(hue: hsv.0, saturation: hsv.1 * 1.1, brightness: min(hsv.2, 0.7), alpha: 1.0) } else { outgoingPrimaryTextColor = .white outgoingSecondaryTextColor = UIColor(rgb: 0xffffff, alpha: 0.65) diff --git a/submodules/TelegramPresentationData/Sources/PresentationStrings.swift b/submodules/TelegramPresentationData/Sources/PresentationStrings.swift index d9d5fb6da7..34a16f9c57 100644 --- a/submodules/TelegramPresentationData/Sources/PresentationStrings.swift +++ b/submodules/TelegramPresentationData/Sources/PresentationStrings.swift @@ -4025,662 +4025,663 @@ public final class PresentationStrings { return formatWithArgumentRanges(self._s[3552]!, self._r[3552]!, [_1, _2, _3]) } public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChannels: String { return self._s[3553]! } - public var VoiceOver_Navigation_Compose: String { return self._s[3554]! } - public var Passport_Identity_EditDriversLicense: String { return self._s[3555]! } - public var Conversation_TapAndHoldToRecord: String { return self._s[3557]! } - public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChats: String { return self._s[3558]! } + public var ScheduledMessages_PollUnavailable: String { return self._s[3554]! } + public var VoiceOver_Navigation_Compose: String { return self._s[3555]! } + public var Passport_Identity_EditDriversLicense: String { return self._s[3556]! } + public var Conversation_TapAndHoldToRecord: String { return self._s[3558]! } + public var SettingsSearch_Synonyms_Notifications_BadgeIncludeMutedChats: String { return self._s[3559]! } public func Notification_CallTimeFormat(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3559]!, self._r[3559]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3560]!, self._r[3560]!, [_1, _2]) } - public var Channel_EditAdmin_PermissionInviteViaLink: String { return self._s[3561]! } + public var Channel_EditAdmin_PermissionInviteViaLink: String { return self._s[3562]! } public func Generic_OpenHiddenLinkAlert(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3563]!, self._r[3563]!, [_0]) + return formatWithArgumentRanges(self._s[3564]!, self._r[3564]!, [_0]) } - public var DialogList_Unread: String { return self._s[3564]! } + public var DialogList_Unread: String { return self._s[3565]! } public func PUSH_CHAT_MESSAGE_GIF(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3565]!, self._r[3565]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3566]!, self._r[3566]!, [_1, _2]) } - public var User_DeletedAccount: String { return self._s[3566]! } - public var OwnershipTransfer_SetupTwoStepAuth: String { return self._s[3567]! } + public var User_DeletedAccount: String { return self._s[3567]! } + public var OwnershipTransfer_SetupTwoStepAuth: String { return self._s[3568]! } public func Watch_Time_ShortYesterdayAt(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3568]!, self._r[3568]!, [_0]) + return formatWithArgumentRanges(self._s[3569]!, self._r[3569]!, [_0]) } - public var UserInfo_NotificationsDefault: String { return self._s[3569]! } - public var SharedMedia_CategoryMedia: String { return self._s[3570]! } - public var SocksProxySetup_ProxyStatusUnavailable: String { return self._s[3571]! } - public var Channel_AdminLog_MessageRestrictedForever: String { return self._s[3572]! } - public var Watch_ChatList_Compose: String { return self._s[3573]! } - public var Notifications_MessageNotificationsExceptionsHelp: String { return self._s[3574]! } - public var AutoDownloadSettings_Delimeter: String { return self._s[3575]! } - public var Watch_Microphone_Access: String { return self._s[3576]! } - public var Group_Setup_HistoryHeader: String { return self._s[3577]! } - public var Map_SetThisLocation: String { return self._s[3578]! } - public var Activity_UploadingPhoto: String { return self._s[3579]! } - public var Conversation_Edit: String { return self._s[3581]! } - public var Group_ErrorSendRestrictedMedia: String { return self._s[3582]! } - public var Login_TermsOfServiceDecline: String { return self._s[3583]! } - public var Message_PinnedContactMessage: String { return self._s[3584]! } + public var UserInfo_NotificationsDefault: String { return self._s[3570]! } + public var SharedMedia_CategoryMedia: String { return self._s[3571]! } + public var SocksProxySetup_ProxyStatusUnavailable: String { return self._s[3572]! } + public var Channel_AdminLog_MessageRestrictedForever: String { return self._s[3573]! } + public var Watch_ChatList_Compose: String { return self._s[3574]! } + public var Notifications_MessageNotificationsExceptionsHelp: String { return self._s[3575]! } + public var AutoDownloadSettings_Delimeter: String { return self._s[3576]! } + public var Watch_Microphone_Access: String { return self._s[3577]! } + public var Group_Setup_HistoryHeader: String { return self._s[3578]! } + public var Map_SetThisLocation: String { return self._s[3579]! } + public var Activity_UploadingPhoto: String { return self._s[3580]! } + public var Conversation_Edit: String { return self._s[3582]! } + public var Group_ErrorSendRestrictedMedia: String { return self._s[3583]! } + public var Login_TermsOfServiceDecline: String { return self._s[3584]! } + public var Message_PinnedContactMessage: String { return self._s[3585]! } public func Channel_AdminLog_MessageRestrictedNameUsername(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3585]!, self._r[3585]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3586]!, self._r[3586]!, [_1, _2]) } public func Login_PhoneBannedEmailBody(_ _1: String, _ _2: String, _ _3: String, _ _4: String, _ _5: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3586]!, self._r[3586]!, [_1, _2, _3, _4, _5]) + return formatWithArgumentRanges(self._s[3587]!, self._r[3587]!, [_1, _2, _3, _4, _5]) } - public var Appearance_LargeEmoji: String { return self._s[3587]! } - public var TwoStepAuth_AdditionalPassword: String { return self._s[3589]! } + public var Appearance_LargeEmoji: String { return self._s[3588]! } + public var TwoStepAuth_AdditionalPassword: String { return self._s[3590]! } public func PUSH_CHAT_DELETE_YOU(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3590]!, self._r[3590]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3591]!, self._r[3591]!, [_1, _2]) } - public var Passport_Phone_EnterOtherNumber: String { return self._s[3591]! } - public var Message_PinnedPhotoMessage: String { return self._s[3592]! } - public var Passport_FieldPhone: String { return self._s[3593]! } - public var TwoStepAuth_RecoveryEmailAddDescription: String { return self._s[3594]! } - public var ChatSettings_AutoPlayGifs: String { return self._s[3595]! } - public var InfoPlist_NSCameraUsageDescription: String { return self._s[3597]! } - public var Conversation_Call: String { return self._s[3598]! } - public var Common_TakePhoto: String { return self._s[3600]! } - public var Group_EditAdmin_RankTitle: String { return self._s[3601]! } - public var Channel_NotificationLoading: String { return self._s[3602]! } + public var Passport_Phone_EnterOtherNumber: String { return self._s[3592]! } + public var Message_PinnedPhotoMessage: String { return self._s[3593]! } + public var Passport_FieldPhone: String { return self._s[3594]! } + public var TwoStepAuth_RecoveryEmailAddDescription: String { return self._s[3595]! } + public var ChatSettings_AutoPlayGifs: String { return self._s[3596]! } + public var InfoPlist_NSCameraUsageDescription: String { return self._s[3598]! } + public var Conversation_Call: String { return self._s[3599]! } + public var Common_TakePhoto: String { return self._s[3601]! } + public var Group_EditAdmin_RankTitle: String { return self._s[3602]! } + public var Channel_NotificationLoading: String { return self._s[3603]! } public func Notification_Exceptions_Sound(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3603]!, self._r[3603]!, [_0]) - } - public func ScheduledMessages_ScheduledDate(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3604]!, self._r[3604]!, [_0]) } + public func ScheduledMessages_ScheduledDate(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3605]!, self._r[3605]!, [_0]) + } public func PUSH_CHANNEL_MESSAGE_VIDEO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3605]!, self._r[3605]!, [_1]) + return formatWithArgumentRanges(self._s[3606]!, self._r[3606]!, [_1]) } - public var Permissions_SiriTitle_v0: String { return self._s[3606]! } + public var Permissions_SiriTitle_v0: String { return self._s[3607]! } public func VoiceOver_Chat_VoiceMessageFrom(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3607]!, self._r[3607]!, [_0]) - } - public func Login_ResetAccountProtected_Text(_ _0: String) -> (String, [(Int, NSRange)]) { return formatWithArgumentRanges(self._s[3608]!, self._r[3608]!, [_0]) } - public var Channel_MessagePhotoRemoved: String { return self._s[3609]! } - public var Common_edit: String { return self._s[3610]! } - public var PrivacySettings_AuthSessions: String { return self._s[3611]! } - public var Month_ShortJune: String { return self._s[3612]! } - public var PrivacyLastSeenSettings_AlwaysShareWith_Placeholder: String { return self._s[3613]! } - public var Call_ReportSend: String { return self._s[3614]! } - public var Watch_LastSeen_JustNow: String { return self._s[3615]! } - public var Notifications_MessageNotifications: String { return self._s[3616]! } - public var WallpaperSearch_ColorGreen: String { return self._s[3617]! } - public var BroadcastListInfo_AddRecipient: String { return self._s[3619]! } - public var Group_Status: String { return self._s[3620]! } + public func Login_ResetAccountProtected_Text(_ _0: String) -> (String, [(Int, NSRange)]) { + return formatWithArgumentRanges(self._s[3609]!, self._r[3609]!, [_0]) + } + public var Channel_MessagePhotoRemoved: String { return self._s[3610]! } + public var Common_edit: String { return self._s[3611]! } + public var PrivacySettings_AuthSessions: String { return self._s[3612]! } + public var Month_ShortJune: String { return self._s[3613]! } + public var PrivacyLastSeenSettings_AlwaysShareWith_Placeholder: String { return self._s[3614]! } + public var Call_ReportSend: String { return self._s[3615]! } + public var Watch_LastSeen_JustNow: String { return self._s[3616]! } + public var Notifications_MessageNotifications: String { return self._s[3617]! } + public var WallpaperSearch_ColorGreen: String { return self._s[3618]! } + public var BroadcastListInfo_AddRecipient: String { return self._s[3620]! } + public var Group_Status: String { return self._s[3621]! } public func AutoNightTheme_LocationHelp(_ _0: String, _ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3621]!, self._r[3621]!, [_0, _1]) + return formatWithArgumentRanges(self._s[3622]!, self._r[3622]!, [_0, _1]) } - public var TextFormat_AddLinkTitle: String { return self._s[3622]! } - public var ShareMenu_ShareTo: String { return self._s[3623]! } - public var Conversation_Moderate_Ban: String { return self._s[3624]! } + public var TextFormat_AddLinkTitle: String { return self._s[3623]! } + public var ShareMenu_ShareTo: String { return self._s[3624]! } + public var Conversation_Moderate_Ban: String { return self._s[3625]! } public func Conversation_DeleteMessagesFor(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3625]!, self._r[3625]!, [_0]) + return formatWithArgumentRanges(self._s[3626]!, self._r[3626]!, [_0]) } - public var SharedMedia_ViewInChat: String { return self._s[3626]! } - public var Map_LiveLocationFor8Hours: String { return self._s[3627]! } + public var SharedMedia_ViewInChat: String { return self._s[3627]! } + public var Map_LiveLocationFor8Hours: String { return self._s[3628]! } public func PUSH_PINNED_PHOTO(_ _1: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3628]!, self._r[3628]!, [_1]) + return formatWithArgumentRanges(self._s[3629]!, self._r[3629]!, [_1]) } public func PUSH_PINNED_POLL(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3629]!, self._r[3629]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3630]!, self._r[3630]!, [_1, _2]) } public func Map_AccurateTo(_ _0: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3631]!, self._r[3631]!, [_0]) + return formatWithArgumentRanges(self._s[3632]!, self._r[3632]!, [_0]) } - public var Map_OpenInHereMaps: String { return self._s[3632]! } - public var Appearance_ReduceMotion: String { return self._s[3633]! } + public var Map_OpenInHereMaps: String { return self._s[3633]! } + public var Appearance_ReduceMotion: String { return self._s[3634]! } public func PUSH_MESSAGE_TEXT(_ _1: String, _ _2: String) -> (String, [(Int, NSRange)]) { - return formatWithArgumentRanges(self._s[3634]!, self._r[3634]!, [_1, _2]) + return formatWithArgumentRanges(self._s[3635]!, self._r[3635]!, [_1, _2]) } - public var Channel_Setup_TypePublicHelp: String { return self._s[3635]! } - public var Passport_Identity_EditInternalPassport: String { return self._s[3636]! } - public var PhotoEditor_Skip: String { return self._s[3637]! } - public func LiveLocationUpdated_MinutesAgo(_ value: Int32) -> String { + public var Channel_Setup_TypePublicHelp: String { return self._s[3636]! } + public var Passport_Identity_EditInternalPassport: String { return self._s[3637]! } + public var PhotoEditor_Skip: String { return self._s[3638]! } + public func Call_ShortSeconds(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[0 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHAT_MESSAGE_PHOTOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + public func PUSH_CHANNEL_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[1 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func MessageTimer_ShortSeconds(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[2 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreExtended(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[3 * 6 + Int(form.rawValue)]!, stringValue) - } - public func AttachmentMenu_SendGif(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[4 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Passport_Scans(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[5 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[6 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func Media_ShareVideo(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[7 * 6 + Int(form.rawValue)]!, stringValue) - } - public func AttachmentMenu_SendPhoto(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[8 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[9 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func MuteExpires_Days(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[10 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreSimple(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[11 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreSelfExtended(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[12 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedPolls(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[13 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_SelectedMessages(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[14 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_DeleteItemsConfirmation(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[15 * 6 + Int(form.rawValue)]!, stringValue) - } - public func QuickSend_Photos(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[16 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_StatusMembers(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[17 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHANNEL_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[18 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func LastSeen_MinutesAgo(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[19 * 6 + Int(form.rawValue)]!, stringValue) - } - public func UserCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[20 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ChatList_SelectedChats(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[21 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedAudios(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[22 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MuteFor_Hours(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[23 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_ShortSeconds(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[24 * 6 + Int(form.rawValue)]!, stringValue) - } - public func AttachmentMenu_SendVideo(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[25 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedLocations(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[26 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHAT_MESSAGES(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[27 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func Map_ETAHours(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[28 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortMinutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[29 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Chat_DeleteMessagesConfirmation(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[30 * 6 + Int(form.rawValue)]!, stringValue) - } - public func LiveLocation_MenuChatsCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[31 * 6 + Int(form.rawValue)]!, stringValue) - } - public func GroupInfo_ParticipantCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[32 * 6 + Int(form.rawValue)]!, stringValue) - } - public func CreatePoll_AddMoreOptions(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[33 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreSimple(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[34 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Forward_ConfirmMultipleFiles(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[35 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Minutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[36 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Seconds(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[37 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedPhotos(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[38 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Invitation_Members(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[39 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notifications_ExceptionMuteExpires_Hours(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[40 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Months(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[41 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Media_ShareItem(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[42 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Map_ETAMinutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[43 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortWeeks(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[44 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_ShortMinutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[45 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Wallpaper_DeleteConfirmation(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[46 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedVideoMessages(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[47 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_Minutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[48 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_RemoveMaskCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[49 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_Generic(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[50 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Hours(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[51 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_StatusSubscribers(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[52 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortDays(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[53 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_Photo(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[54 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_AddMaskCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[55 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessagePoll_VotedCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[56 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[57 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func Conversation_LiveLocationMembersCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[58 * 6 + Int(form.rawValue)]!, stringValue) - } - public func VoiceOver_Chat_PollOptionCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[59 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Years(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[60 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreSelfSimple(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[61 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedFiles(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[62 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedAuthorsOthers(_ selector: Int32, _ _0: String, _ _1: String) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[63 * 6 + Int(form.rawValue)]!, _0, _1) - } - public func MuteFor_Days(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[64 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notification_GameScoreExtended(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[65 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedStickers(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[66 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Call_Seconds(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[67 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedGifs(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[68 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_ShortHours(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[69 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MuteExpires_Minutes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[70 * 6 + Int(form.rawValue)]!, stringValue) - } - public func MessageTimer_Days(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[71 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Media_SharePhoto(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[72 * 6 + Int(form.rawValue)]!, stringValue) - } - public func SharedMedia_Video(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[73 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedMessages(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[74 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreSelfSimple(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[75 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PrivacyLastSeenSettings_AddUsers(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[76 * 6 + Int(form.rawValue)]!, stringValue) - } - public func VoiceOver_Chat_ContactEmailCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[77 * 6 + Int(form.rawValue)]!, stringValue) - } - public func InviteText_ContactsCountText(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[78 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Watch_UserInfo_Mute(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[79 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_AddStickerCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[80 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PUSH_CHAT_MESSAGE_VIDEOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[81 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func SharedMedia_Link(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[82 * 6 + Int(form.rawValue)]!, stringValue) - } - public func PasscodeSettings_FailedAttempts(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[83 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedContacts(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[84 * 6 + Int(form.rawValue)]!, stringValue) - } - public func StickerPack_RemoveStickerCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[85 * 6 + Int(form.rawValue)]!, stringValue) - } - public func DialogList_LiveLocationChatsCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[86 * 6 + Int(form.rawValue)]!, stringValue) - } - public func VoiceOver_Chat_PollVotes(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[87 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Contacts_ImportersCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[88 * 6 + Int(form.rawValue)]!, stringValue) - } - public func VoiceOver_Chat_ContactPhoneNumberCount(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[89 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Conversation_StatusOnline(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[90 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Watch_LastSeen_MinutesAgo(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[91 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ServiceMessage_GameScoreSelfExtended(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[92 * 6 + Int(form.rawValue)]!, stringValue) - } - public func AttachmentMenu_SendItem(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[93 * 6 + Int(form.rawValue)]!, stringValue) - } - public func ForwardedVideos(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[94 * 6 + Int(form.rawValue)]!, stringValue) - } - public func Notifications_Exceptions(_ value: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, value) - let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[95 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[1 * 6 + Int(form.rawValue)]!, _1, _2) } public func ChatList_DeleteConfirmation(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[96 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[2 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[97 * 6 + Int(form.rawValue)]!, _1, _2) + public func MessageTimer_Seconds(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[3 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedVideoMessages(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[4 * 6 + Int(form.rawValue)]!, stringValue) + } + public func AttachmentMenu_SendVideo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[5 * 6 + Int(form.rawValue)]!, stringValue) + } + public func CreatePoll_AddMoreOptions(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[6 * 6 + Int(form.rawValue)]!, stringValue) + } + public func UserCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[7 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessagePoll_VotedCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[8 * 6 + Int(form.rawValue)]!, stringValue) + } + public func VoiceOver_Chat_ContactPhoneNumberCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[9 * 6 + Int(form.rawValue)]!, stringValue) + } + public func InviteText_ContactsCountText(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[10 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Map_ETAHours(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[11 * 6 + Int(form.rawValue)]!, stringValue) + } + public func SharedMedia_Link(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[12 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Chat_DeleteMessagesConfirmation(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[13 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Minutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[14 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Invitation_Members(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[15 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Map_ETAMinutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[16 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Media_ShareVideo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[17 * 6 + Int(form.rawValue)]!, stringValue) } public func MuteExpires_Hours(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[98 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[18 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHANNEL_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[99 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func PUSH_CHANNEL_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[100 * 6 + Int(form.rawValue)]!, _1, _2) - } - public func PUSH_CHAT_MESSAGE_ROUNDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[101 * 6 + Int(form.rawValue)]!, _2, _1, _3) - } - public func MessageTimer_Weeks(_ value: Int32) -> String { + public func Call_ShortMinutes(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[102 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[19 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHANNEL_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + public func PUSH_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[103 * 6 + Int(form.rawValue)]!, _1, _2) + return String(format: self._ps[20 * 6 + Int(form.rawValue)]!, _1, _2) } - public func StickerPack_StickerCount(_ value: Int32) -> String { + public func ServiceMessage_GameScoreExtended(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[104 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[21 * 6 + Int(form.rawValue)]!, stringValue) } - public func LastSeen_HoursAgo(_ value: Int32) -> String { + public func PasscodeSettings_FailedAttempts(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[105 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[22 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedLocations(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[23 * 6 + Int(form.rawValue)]!, stringValue) } public func SharedMedia_File(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[106 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[24 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ServiceMessage_GameScoreSelfExtended(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[25 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortMinutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[26 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PrivacyLastSeenSettings_AddUsers(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[27 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LiveLocation_MenuChatsCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[28 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_AddStickerCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[29 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Hours(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[30 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedFiles(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[31 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[32 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func StickerPack_AddMaskCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[33 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortHours(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[34 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreExtended(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[35 * 6 + Int(form.rawValue)]!, stringValue) + } + public func SharedMedia_Photo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[36 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notifications_ExceptionMuteExpires_Days(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[37 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Passport_Scans(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[38 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MuteFor_Hours(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[39 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedPhotos(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[40 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Contacts_ImportersCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[41 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_RemoveStickerCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[42 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Years(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[43 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[44 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func ForwardedContacts(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[45 * 6 + Int(form.rawValue)]!, stringValue) + } + public func DialogList_LiveLocationChatsCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[46 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Weeks(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[47 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_FWDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[48 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func PUSH_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[49 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func ChatList_SelectedChats(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[50 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGE_PHOTOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[51 * 6 + Int(form.rawValue)]!, _1, _2) } public func PUSH_CHAT_MESSAGE_FWDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[107 * 6 + Int(form.rawValue)]!, _2, _1, _3) + return String(format: self._ps[52 * 6 + Int(form.rawValue)]!, _2, _1, _3) } - public func Notifications_ExceptionMuteExpires_Minutes(_ value: Int32) -> String { + public func PUSH_CHAT_MESSAGE_VIDEOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[53 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func MessageTimer_Months(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) - return String(format: self._ps[108 * 6 + Int(form.rawValue)]!, stringValue) + return String(format: self._ps[54 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHANNEL_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[55 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func MuteExpires_Days(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[56 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortWeeks(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[57 * 6 + Int(form.rawValue)]!, stringValue) + } + public func QuickSend_Photos(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[58 * 6 + Int(form.rawValue)]!, stringValue) + } + public func AttachmentMenu_SendGif(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[59 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Forward_ConfirmMultipleFiles(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[60 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_RemoveMaskCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[61 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedGifs(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[62 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreSelfSimple(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[63 * 6 + Int(form.rawValue)]!, stringValue) + } + public func SharedMedia_DeleteItemsConfirmation(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[64 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Call_Seconds(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[65 * 6 + Int(form.rawValue)]!, stringValue) } public func Watch_LastSeen_HoursAgo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[66 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedMessages(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[67 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ServiceMessage_GameScoreSimple(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[68 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notifications_ExceptionMuteExpires_Hours(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[69 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LastSeen_HoursAgo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[70 * 6 + Int(form.rawValue)]!, stringValue) + } + public func AttachmentMenu_SendPhoto(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[71 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LastSeen_MinutesAgo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[72 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedAudios(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[73 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortDays(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[74 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Media_SharePhoto(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[75 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Media_ShareItem(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[76 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Call_Minutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[77 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedAuthorsOthers(_ selector: Int32, _ _0: String, _ _1: String) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[78 * 6 + Int(form.rawValue)]!, _0, _1) + } + public func PUSH_CHAT_MESSAGE_ROUNDS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[79 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func PUSH_CHANNEL_MESSAGES(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[80 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func Notifications_ExceptionMuteExpires_Minutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[81 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_MESSAGE_VIDEOS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[82 * 6 + Int(form.rawValue)]!, _1, _2) + } + public func Conversation_StatusOnline(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[83 * 6 + Int(form.rawValue)]!, stringValue) + } + public func LiveLocationUpdated_MinutesAgo(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[84 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_LiveLocationMembersCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[85 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ServiceMessage_GameScoreSelfSimple(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[86 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_StatusSubscribers(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[87 * 6 + Int(form.rawValue)]!, stringValue) + } + public func VoiceOver_Chat_PollOptionCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[88 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_Days(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[89 * 6 + Int(form.rawValue)]!, stringValue) + } + public func AttachmentMenu_SendItem(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[90 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedVideos(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[91 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MessageTimer_ShortSeconds(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[92 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Wallpaper_DeleteConfirmation(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[93 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Conversation_SelectedMessages(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[94 * 6 + Int(form.rawValue)]!, stringValue) + } + public func ForwardedStickers(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[95 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Watch_UserInfo_Mute(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[96 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notifications_Exceptions(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[97 * 6 + Int(form.rawValue)]!, stringValue) + } + public func SharedMedia_Generic(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[98 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHAT_MESSAGES(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[99 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func MuteExpires_Minutes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[100 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreSelfExtended(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[101 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Notification_GameScoreSimple(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[102 * 6 + Int(form.rawValue)]!, stringValue) + } + public func PUSH_CHAT_MESSAGE_PHOTOS(_ selector: Int32, _ _2: String, _ _1: String, _ _3: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, selector) + return String(format: self._ps[103 * 6 + Int(form.rawValue)]!, _2, _1, _3) + } + public func Conversation_StatusMembers(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[104 * 6 + Int(form.rawValue)]!, stringValue) + } + public func MuteFor_Days(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[105 * 6 + Int(form.rawValue)]!, stringValue) + } + public func StickerPack_StickerCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[106 * 6 + Int(form.rawValue)]!, stringValue) + } + public func VoiceOver_Chat_PollVotes(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[107 * 6 + Int(form.rawValue)]!, stringValue) + } + public func GroupInfo_ParticipantCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[108 * 6 + Int(form.rawValue)]!, stringValue) + } + public func Watch_LastSeen_MinutesAgo(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[109 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[110 * 6 + Int(form.rawValue)]!, _1, _2) + public func VoiceOver_Chat_ContactEmailCount(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[110 * 6 + Int(form.rawValue)]!, stringValue) } - public func PUSH_CHANNEL_MESSAGE_ROUNDS(_ selector: Int32, _ _1: String, _ _2: Int32) -> String { - let form = presentationStringsPluralizationForm(self.lc, selector) - return String(format: self._ps[111 * 6 + Int(form.rawValue)]!, _1, _2) + public func SharedMedia_Video(_ value: Int32) -> String { + let form = presentationStringsPluralizationForm(self.lc, value) + let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) + return String(format: self._ps[111 * 6 + Int(form.rawValue)]!, stringValue) } - public func Notifications_ExceptionMuteExpires_Days(_ value: Int32) -> String { + public func ForwardedPolls(_ value: Int32) -> String { let form = presentationStringsPluralizationForm(self.lc, value) let stringValue = presentationStringsFormattedNumber(value, self.groupingSeparator) return String(format: self._ps[112 * 6 + Int(form.rawValue)]!, stringValue) diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift index e21dfcda23..acd39be630 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesChatList.swift @@ -1,7 +1,6 @@ import Foundation import UIKit import Display -import TelegramPresentationData private func generateStatusCheckImage(theme: PresentationTheme, single: Bool) -> UIImage? { return generateImage(CGSize(width: single ? 13.0 : 18.0, height: 13.0), rotatedContext: { size, context in diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesItemList.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesItemList.swift index 30417c5c09..10be928c5c 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesItemList.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesItemList.swift @@ -1,7 +1,6 @@ import Foundation import UIKit import Display -import TelegramPresentationData private func generateArrowImage(_ theme: PresentationTheme) -> UIImage? { return generateImage(CGSize(width: 7.0, height: 13.0), rotatedContext: { size, context in diff --git a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesRootController.swift b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesRootController.swift index 8b8fc7b2cc..2ef6886592 100644 --- a/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesRootController.swift +++ b/submodules/TelegramPresentationData/Sources/Resources/PresentationResourcesRootController.swift @@ -1,7 +1,6 @@ import Foundation import UIKit import Display -import TelegramPresentationData private func generateShareButtonImage(theme: PresentationTheme) -> UIImage? { return generateTintedImage(image: UIImage(bundleImageName: "Chat List/NavigationShare"), color: theme.rootController.navigationBar.accentTextColor) diff --git a/submodules/TelegramPresentationData/Sources/StringPluralization.swift b/submodules/TelegramPresentationData/Sources/StringPluralization.swift index 6eccf01d42..8b4c8ad126 100644 --- a/submodules/TelegramPresentationData/Sources/StringPluralization.swift +++ b/submodules/TelegramPresentationData/Sources/StringPluralization.swift @@ -40,5 +40,7 @@ func presentationStringsPluralizationForm(_ lc: UInt32, _ value: Int32) -> Plura return .many case .other: return .other + @unknown default: + fatalError() } } diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryControllerNode.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryControllerNode.swift index 6ecb2c7cfd..e8b4efef12 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryControllerNode.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequencePhoneEntryControllerNode.swift @@ -107,6 +107,8 @@ private final class PhoneAndCountryNode: ASDisplayNode { self.phoneInputNode.numberField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance self.phoneInputNode.countryCodeField.textField.textColor = theme.list.itemPrimaryTextColor self.phoneInputNode.numberField.textField.textColor = theme.list.itemPrimaryTextColor + self.phoneInputNode.countryCodeField.textField.tintColor = theme.list.itemAccentColor + self.phoneInputNode.numberField.textField.tintColor = theme.list.itemAccentColor self.phoneInputNode.countryCodeField.textField.tintColor = theme.list.itemAccentColor self.phoneInputNode.numberField.textField.tintColor = theme.list.itemAccentColor diff --git a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpControllerNode.swift b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpControllerNode.swift index 8c16e1952c..4b30dbbc48 100644 --- a/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpControllerNode.swift +++ b/submodules/TelegramUI/TelegramUI/AuthorizationSequenceSignUpControllerNode.swift @@ -108,6 +108,8 @@ final class AuthorizationSequenceSignUpControllerNode: ASDisplayNode, UITextFiel if #available(iOSApplicationExtension 10.0, iOS 10.0, *) { self.firstNameField.textField.textContentType = .givenName } + self.firstNameField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.firstNameField.textField.tintColor = theme.list.itemAccentColor self.lastNameField = TextFieldNode() self.lastNameField.textField.font = Font.regular(20.0) @@ -120,6 +122,8 @@ final class AuthorizationSequenceSignUpControllerNode: ASDisplayNode, UITextFiel if #available(iOSApplicationExtension 10.0, iOS 10.0, *) { self.lastNameField.textField.textContentType = .familyName } + self.lastNameField.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.lastNameField.textField.tintColor = theme.list.itemAccentColor self.currentPhotoNode = ASImageNode() self.currentPhotoNode.isUserInteractionEnabled = false diff --git a/submodules/TelegramUI/TelegramUI/ChatController.swift b/submodules/TelegramUI/TelegramUI/ChatController.swift index fbc1ac2e5f..6fc99639b2 100644 --- a/submodules/TelegramUI/TelegramUI/ChatController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatController.swift @@ -543,6 +543,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G reactionItems.append(ReactionContextItem(value: value, text: text, path: path)) } } + if Namespaces.Message.allScheduled.contains(message.id.namespace) { + reactionItems = [] + } let controller = ContextController(account: strongSelf.context.account, theme: strongSelf.presentationData.theme, strings: strongSelf.presentationData.strings, source: ChatMessageContextControllerContentSource(chatNode: strongSelf.chatDisplayNode, message: message), items: actions, reactionItems: reactionItems, recognizer: recognizer) strongSelf.currentContextController = controller controller.reactionSelected = { [weak controller] value in @@ -1395,6 +1398,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G guard let strongSelf = self, let controllerInteraction = strongSelf.controllerInteraction else { return } + guard !strongSelf.presentationInterfaceState.isScheduledMessages else { + strongSelf.present(textAlertController(context: strongSelf.context, title: nil, text: strongSelf.presentationData.strings.ScheduledMessages_PollUnavailable, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) + return + } if controllerInteraction.pollActionState.pollMessageIdsInProgress[id] == nil { controllerInteraction.pollActionState.pollMessageIdsInProgress[id] = opaqueIdentifier strongSelf.chatDisplayNode.historyNode.requestMessageUpdate(id) @@ -2804,7 +2811,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } else { text = "\(count) messages selected" } - UIAccessibility.post(notification: UIAccessibility.Notification.announcement, argument: text) + UIAccessibility.post(notification: UIAccessibility.Notification.announcement, argument: text) } } }, deleteSelectedMessages: { [weak self] in @@ -4547,6 +4554,12 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G self.chatDisplayNode.updateChatPresentationInterfaceState(updatedChatPresentationInterfaceState, transition: transition, interactive: interactive) } + if let selectionState = self.presentationInterfaceState.interfaceState.selectionState, !selectionState.selectedIds.isEmpty { + self.chatTitleView?.titleContent = .custom(self.presentationData.strings.Conversation_SelectedMessages(Int32(selectionState.selectedIds.count))) + } else { + + } + if let button = leftNavigationButtonForChatInterfaceState(updatedChatPresentationInterfaceState, strings: updatedChatPresentationInterfaceState.strings, currentButton: self.leftNavigationButton, target: self, selector: #selector(self.leftNavigationButtonAction)) { if self.leftNavigationButton != button { var animated = transition.isAnimated @@ -4586,7 +4599,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G switch updatedChatPresentationInterfaceState.mode { case .standard: self.statusBar.statusBarStyle = self.presentationData.theme.rootController.statusBarStyle.style - self.deferScreenEdgeGestures = [] + self.deferScreenEdgeGestures = [] case .overlay: self.statusBar.statusBarStyle = .Hide self.deferScreenEdgeGestures = [.top] @@ -7383,9 +7396,7 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G if let peer = peer as? TelegramUser { let recipientHandle = INPersonHandle(value: "tg\(peerId.id)", type: .unknown) let recipient = INPerson(personHandle: recipientHandle, nameComponents: nil, displayName: peer.displayTitle, image: nil, contactIdentifier: nil, customIdentifier: "tg\(peerId.id)") - let intent = INSendMessageIntent(recipients: [recipient], content: nil, groupName: nil, serviceName: nil, sender: nil) - let interaction = INInteraction(intent: intent, response: nil) interaction.direction = .outgoing interaction.donate { error in diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift index 4b14c69a62..a7345909f0 100644 --- a/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift +++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceInputContexts.swift @@ -258,7 +258,8 @@ func inputTextPanelStateForChatPresentationInterfaceState(_ chatPresentationInte accessoryItems.append(.messageAutoremoveTimeout(peer.messageAutoremoveTimeout)) } } - if chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 { + + if chatPresentationInterfaceState.interfaceState.composeInputState.inputText.length == 0 && chatPresentationInterfaceState.interfaceState.forwardMessageIds == nil { if chatPresentationInterfaceState.hasScheduledMessages { accessoryItems.append(.scheduledMessages) } diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift index 55fc4d6616..d3fdf95efa 100644 --- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift +++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateInputPanels.swift @@ -169,13 +169,15 @@ func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState } var displayBotStartPanel = false - if let _ = chatPresentationInterfaceState.botStartPayload { - if let user = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, user.botInfo != nil { - displayBotStartPanel = true - } - } else if let chatHistoryState = chatPresentationInterfaceState.chatHistoryState, case .loaded(true) = chatHistoryState { - if let user = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, user.botInfo != nil { - displayBotStartPanel = true + if !chatPresentationInterfaceState.isScheduledMessages { + if let _ = chatPresentationInterfaceState.botStartPayload { + if let user = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, user.botInfo != nil { + displayBotStartPanel = true + } + } else if let chatHistoryState = chatPresentationInterfaceState.chatHistoryState, case .loaded(true) = chatHistoryState { + if let user = chatPresentationInterfaceState.renderedPeer?.peer as? TelegramUser, user.botInfo != nil { + displayBotStartPanel = true + } } } diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift index 6e01bc0ca1..ec7696a61a 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageBubbleItemNode.swift @@ -400,7 +400,7 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePrevewItemNode let reactionRecognizer = ReactionSwipeGestureRecognizer(target: nil, action: nil) self.reactionRecognizer = reactionRecognizer reactionRecognizer.availableReactions = { [weak self] in - guard let strongSelf = self, let item = strongSelf.item else { + guard let strongSelf = self, let item = strongSelf.item, !Namespaces.Message.allScheduled.contains(item.message.id.namespace) else { return [] } if strongSelf.selectionNode != nil { diff --git a/submodules/TelegramUI/TelegramUI/ChatMessagePollBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessagePollBubbleContentNode.swift index 76b54dc82b..aed1d76ab6 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessagePollBubbleContentNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessagePollBubbleContentNode.swift @@ -773,6 +773,9 @@ class ChatMessagePollBubbleContentNode: ChatMessageBubbleContentNode { canVote = true } } + if Namespaces.Message.allScheduled.contains(item.message.id.namespace) { + canVote = true + } return (boundingSize.width, { boundingWidth in var resultSize = CGSize(width: max(boundingSize.width, boundingWidth), height: boundingSize.height) diff --git a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift index dbe27e03d3..06bff51447 100644 --- a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeController.swift @@ -24,6 +24,8 @@ final class ChatScheduleTimeController: ViewController { private let currentTime: Int32? private let completion: (Int32) -> Void + private var presentationDataDisposable: Disposable? + init(context: AccountContext, mode: ChatScheduleTimeControllerMode, currentTime: Int32? = nil, completion: @escaping (Int32) -> Void) { self.context = context self.mode = mode @@ -32,6 +34,13 @@ final class ChatScheduleTimeController: ViewController { super.init(navigationBarPresentationData: nil) + self.presentationDataDisposable = (context.sharedContext.presentationData + |> deliverOnMainQueue).start(next: { [weak self] presentationData in + if let strongSelf = self { + strongSelf.controllerNode.updatePresentationData(presentationData) + } + }) + self.statusBar.statusBarStyle = .Ignore } @@ -39,6 +48,10 @@ final class ChatScheduleTimeController: ViewController { fatalError("init(coder:) has not been implemented") } + deinit { + self.presentationDataDisposable?.dispose() + } + override public func loadDisplayNode() { self.displayNode = ChatScheduleTimeControllerNode(context: self.context, mode: self.mode, currentTime: self.currentTime) self.controllerNode.completion = { [weak self] time in diff --git a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeControllerNode.swift b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeControllerNode.swift index 37a54dc28b..2f1edf11ca 100644 --- a/submodules/TelegramUI/TelegramUI/ChatScheduleTimeControllerNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatScheduleTimeControllerNode.swift @@ -20,7 +20,6 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel private let contentContainerNode: ASDisplayNode private let contentBackgroundNode: ASImageNode private let titleNode: ASTextNode - private let separatorNode: ASDisplayNode private let cancelButton: HighlightableButtonNode private let doneButton: SolidRoundedButtonNode @@ -46,8 +45,6 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.dimNode = ASDisplayNode() self.dimNode.backgroundColor = UIColor(white: 0.0, alpha: 0.5) - let roundedBackground = generateStretchableFilledCircleImage(radius: 16.0, color: self.presentationData.theme.actionSheet.opaqueItemBackgroundColor) - self.contentContainerNode = ASDisplayNode() self.contentContainerNode.isOpaque = false self.contentContainerNode.clipsToBounds = true @@ -55,7 +52,7 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.contentBackgroundNode = ASImageNode() self.contentBackgroundNode.displaysAsynchronously = false self.contentBackgroundNode.displayWithoutProcessing = true - self.contentBackgroundNode.image = roundedBackground + self.contentBackgroundNode.image = generateStretchableFilledCircleImage(radius: 16.0, color: self.presentationData.theme.actionSheet.opaqueItemBackgroundColor) let title: String switch mode { @@ -68,9 +65,6 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.titleNode = ASTextNode() self.titleNode.attributedText = NSAttributedString(string: title, font: Font.bold(17.0), textColor: self.presentationData.theme.actionSheet.primaryTextColor) - self.separatorNode = ASDisplayNode() - //self.separatorNode.backgroundColor = self.theme.controlColor - self.cancelButton = HighlightableButtonNode() self.cancelButton.setTitle(self.presentationData.strings.Common_Cancel, with: Font.regular(17.0), with: self.presentationData.theme.actionSheet.controlAccentColor, for: .normal) @@ -107,7 +101,6 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.pickerView.timeZone = TimeZone.current self.pickerView.minuteInterval = 1 self.pickerView.setValue(self.presentationData.theme.actionSheet.primaryTextColor, forKey: "textColor") - self.contentContainerNode.view.addSubview(self.pickerView) self.pickerView.addTarget(self, action: #selector(self.datePickerUpdated), for: .valueChanged) @@ -116,6 +109,7 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel if let strongSelf = self { if strongSelf.pickerView.date < Date() { strongSelf.updateMinimumDate() + strongSelf.updateButtonTitle() strongSelf.pickerView.layer.addShakeAnimation() } else { strongSelf.doneButton.isUserInteractionEnabled = false @@ -128,6 +122,17 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.updateButtonTitle() } + func updatePresentationData(_ presentationData: PresentationData) { + self.presentationData = presentationData + + self.contentBackgroundNode.image = generateStretchableFilledCircleImage(radius: 16.0, color: self.presentationData.theme.actionSheet.opaqueItemBackgroundColor) + self.titleNode.attributedText = NSAttributedString(string: self.titleNode.attributedText?.string ?? "", font: Font.bold(17.0), textColor: self.presentationData.theme.actionSheet.primaryTextColor) + self.pickerView.setValue(self.presentationData.theme.actionSheet.primaryTextColor, forKey: "textColor") + + self.cancelButton.setTitle(self.presentationData.strings.Common_Cancel, with: Font.regular(17.0), with: self.presentationData.theme.actionSheet.controlAccentColor, for: .normal) + self.doneButton.updateTheme(self.presentationData.theme) + } + private func updateMinimumDate(currentTime: Int32? = nil) { let timeZone = TimeZone(secondsFromGMT: 0)! var calendar = Calendar(identifier: .gregorian) @@ -137,16 +142,19 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel components.second = 0 let minute = (components.minute ?? 0) % 5 + let next1MinDate = calendar.date(byAdding: .minute, value: 1, to: calendar.date(from: components)!) + let next5MinDate = calendar.date(byAdding: .minute, value: 5 - minute, to: calendar.date(from: components)!) + if let date = calendar.date(byAdding: .day, value: 365, to: currentDate) { self.pickerView.maximumDate = date } - if let date = calendar.date(byAdding: .minute, value: 5 - minute, to: calendar.date(from: components)!) { - self.pickerView.minimumDate = date - if let currentTime = currentTime { + if let next1MinDate = next1MinDate, let next5MinDate = next5MinDate { + self.pickerView.minimumDate = next1MinDate + if let currentTime = currentTime, Double(currentTime) > currentDate.timeIntervalSince1970 { self.pickerView.date = Date(timeIntervalSince1970: Double(currentTime)) } else { - self.pickerView.date = date + self.pickerView.date = next5MinDate } } } @@ -300,6 +308,5 @@ class ChatScheduleTimeControllerNode: ViewControllerTracingNode, UIScrollViewDel self.pickerView.frame = CGRect(origin: CGPoint(x: 0.0, y: 54.0), size: CGSize(width: contentFrame.width, height: pickerHeight)) transition.updateFrame(node: self.contentContainerNode, frame: contentContainerFrame) - transition.updateFrame(node: self.separatorNode, frame: CGRect(origin: CGPoint(x: 0.0, y: titleHeight), size: CGSize(width: contentContainerFrame.size.width, height: UIScreenPixel))) } } diff --git a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift index dd29ba6193..bfa4f44305 100644 --- a/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift +++ b/submodules/TelegramUI/TelegramUI/ChatTextLinkEditController.swift @@ -57,6 +57,7 @@ private final class ChatTextLinkEditInputFieldNode: ASDisplayNode, ASEditableTex self.textInputNode.autocapitalizationType = .none self.textInputNode.returnKeyType = .done self.textInputNode.autocorrectionType = .no + self.textInputNode.tintColor = theme.actionSheet.controlAccentColor self.placeholderNode = ASTextNode() self.placeholderNode.isUserInteractionEnabled = false @@ -75,9 +76,10 @@ private final class ChatTextLinkEditInputFieldNode: ASDisplayNode, ASEditableTex func updateTheme(_ theme: PresentationTheme) { self.theme = theme - self.backgroundNode.image = generateStretchableFilledCircleImage(diameter: 33.0, color: theme.actionSheet.inputHollowBackgroundColor, strokeColor: theme.actionSheet.inputBorderColor, strokeWidth: 1.0) - self.textInputNode.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.backgroundNode.image = generateStretchableFilledCircleImage(diameter: 33.0, color: self.theme.actionSheet.inputHollowBackgroundColor, strokeColor: self.theme.actionSheet.inputBorderColor, strokeWidth: 1.0) + self.textInputNode.keyboardAppearance = self.theme.chatList.searchBarKeyboardColor.keyboardAppearance self.placeholderNode.attributedText = NSAttributedString(string: self.placeholderNode.attributedText?.string ?? "", font: Font.regular(17.0), textColor: self.theme.actionSheet.inputPlaceholderColor) + self.textInputNode.tintColor = self.theme.actionSheet.controlAccentColor } func updateLayout(width: CGFloat, transition: ContainedViewLayoutTransition) -> CGFloat { diff --git a/submodules/TelegramUI/TelegramUI/ChatTitleView.swift b/submodules/TelegramUI/TelegramUI/ChatTitleView.swift index cd1ab18e93..90f968a5e1 100644 --- a/submodules/TelegramUI/TelegramUI/ChatTitleView.swift +++ b/submodules/TelegramUI/TelegramUI/ChatTitleView.swift @@ -16,6 +16,7 @@ import ChatTitleActivityNode enum ChatTitleContent { case peer(peerView: PeerView, onlineMemberCount: Int32?, isScheduledMessages: Bool) case group([Peer]) + case custom(String) } private final class ChatTitleNetworkStatusNode: ASDisplayNode { @@ -182,7 +183,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView { switch titleContent { case let .peer(peerView, _, isScheduledMessages): if isScheduledMessages { - if let peer = peerViewMainPeer(peerView), peerView.peerId == self.account.peerId { + if peerView.peerId == self.account.peerId { string = NSAttributedString(string: self.strings.ScheduledMessages_RemindersTitle, font: Font.medium(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor) } else { string = NSAttributedString(string: self.strings.ScheduledMessages_Title, font: Font.medium(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor) @@ -212,6 +213,8 @@ final class ChatTitleView: UIView, NavigationBarTitleView { } case .group: string = NSAttributedString(string: "Feed", font: Font.medium(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor) + case let .custom(text): + string = NSAttributedString(string: text, font: Font.medium(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor) } if let string = string, self.titleNode.attributedText == nil || !self.titleNode.attributedText!.isEqual(to: string) { @@ -263,7 +266,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView { } } default: - break + inputActivitiesAllowed = false } } @@ -429,7 +432,7 @@ final class ChatTitleView: UIView, NavigationBarTitleView { } } } - case .group: + default: break } diff --git a/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift b/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift index 2440b470ec..5fdbbca17e 100644 --- a/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift +++ b/submodules/TelegramUI/TelegramUI/ContactMultiselectionControllerNode.swift @@ -67,7 +67,7 @@ final class ContactMultiselectionControllerNode: ASDisplayNode { } self.contactListNode = ContactListNode(context: context, presentation: .single(.natural(options: options, includeChatList: includeChatList)), filters: filters, selectionState: ContactListNodeGroupSelectionState()) - self.tokenListNode = EditableTokenListNode(theme: EditableTokenListNodeTheme(backgroundColor: self.presentationData.theme.rootController.navigationBar.backgroundColor, separatorColor: self.presentationData.theme.rootController.navigationBar.separatorColor, placeholderTextColor: self.presentationData.theme.list.itemPlaceholderTextColor, primaryTextColor: self.presentationData.theme.list.itemPrimaryTextColor, selectedTextColor: self.presentationData.theme.list.itemAccentColor, keyboardColor: self.presentationData.theme.chatList.searchBarKeyboardColor), placeholder: placeholder) + self.tokenListNode = EditableTokenListNode(theme: EditableTokenListNodeTheme(backgroundColor: self.presentationData.theme.rootController.navigationBar.backgroundColor, separatorColor: self.presentationData.theme.rootController.navigationBar.separatorColor, placeholderTextColor: self.presentationData.theme.list.itemPlaceholderTextColor, primaryTextColor: self.presentationData.theme.list.itemPrimaryTextColor, selectedTextColor: self.presentationData.theme.list.itemAccentColor, accentColor: self.presentationData.theme.list.itemAccentColor, keyboardColor: self.presentationData.theme.chatList.searchBarKeyboardColor), placeholder: placeholder) super.init() diff --git a/submodules/TelegramUI/TelegramUI/EditableTokenListNode.swift b/submodules/TelegramUI/TelegramUI/EditableTokenListNode.swift index 7fbd691ab8..f87bd36ea9 100644 --- a/submodules/TelegramUI/TelegramUI/EditableTokenListNode.swift +++ b/submodules/TelegramUI/TelegramUI/EditableTokenListNode.swift @@ -32,14 +32,16 @@ final class EditableTokenListNodeTheme { let placeholderTextColor: UIColor let primaryTextColor: UIColor let selectedTextColor: UIColor + let accentColor: UIColor let keyboardColor: PresentationThemeKeyboardColor - init(backgroundColor: UIColor, separatorColor: UIColor, placeholderTextColor: UIColor, primaryTextColor: UIColor, selectedTextColor: UIColor, keyboardColor: PresentationThemeKeyboardColor) { + init(backgroundColor: UIColor, separatorColor: UIColor, placeholderTextColor: UIColor, primaryTextColor: UIColor, selectedTextColor: UIColor, accentColor: UIColor, keyboardColor: PresentationThemeKeyboardColor) { self.backgroundColor = backgroundColor self.separatorColor = separatorColor self.placeholderTextColor = placeholderTextColor self.primaryTextColor = primaryTextColor self.selectedTextColor = selectedTextColor + self.accentColor = accentColor self.keyboardColor = keyboardColor } } @@ -123,12 +125,8 @@ final class EditableTokenListNode: ASDisplayNode, UITextFieldDelegate { self.textFieldNode.textField.textColor = theme.primaryTextColor self.textFieldNode.textField.autocorrectionType = .no self.textFieldNode.textField.returnKeyType = .done - switch theme.keyboardColor { - case .light: - self.textFieldNode.textField.keyboardAppearance = .default - case .dark: - self.textFieldNode.textField.keyboardAppearance = .dark - } + self.textFieldNode.textField.keyboardAppearance = theme.keyboardColor.keyboardAppearance + self.textFieldNode.textField.tintColor = theme.accentColor self.caretIndicatorNode = CaretIndicatorNode() self.caretIndicatorNode.isLayerBacked = true diff --git a/submodules/TelegramUI/TelegramUI/PaneSearchBarNode.swift b/submodules/TelegramUI/TelegramUI/PaneSearchBarNode.swift index bd33c25ea0..24942576cf 100644 --- a/submodules/TelegramUI/TelegramUI/PaneSearchBarNode.swift +++ b/submodules/TelegramUI/TelegramUI/PaneSearchBarNode.swift @@ -263,13 +263,8 @@ class PaneSearchBarNode: ASDisplayNode, UITextFieldDelegate { self.iconNode.image = generateLoupeIcon(color: theme.chat.inputMediaPanel.stickersSearchControlColor) self.clearButton.setImage(generateClearIcon(color: theme.chat.inputMediaPanel.stickersSearchControlColor), for: []) self.cancelButton.setAttributedTitle(NSAttributedString(string: strings.Common_Cancel, font: Font.regular(17.0), textColor: theme.chat.inputPanel.panelControlAccentColor), for: []) - - switch theme.chatList.searchBarKeyboardColor { - case .light: - self.textField.keyboardAppearance = .default - case .dark: - self.textField.keyboardAppearance = .dark - } + self.textField.keyboardAppearance = theme.chatList.searchBarKeyboardColor.keyboardAppearance + self.textField.tintColor = theme.list.itemAccentColor if let (boundingSize, leftInset, rightInset) = self.validLayout { self.updateLayout(boundingSize: boundingSize, leftInset: leftInset, rightInset: rightInset, transition: .immediate) diff --git a/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping b/submodules/TelegramUI/TelegramUI/Resources/PresentationStrings.mapping index 48966ed8aa8a59e95ddfcbf5e32580defb14d108..15581c43547a9ecd589f3acd25f4d61ad96340c7 100644 GIT binary patch delta 2681 zcmZuzYiwI*8TRYt#JSkc&DYpTZ0DXeZo8(i4oI6N&ZWdj+T-*BWA3T_r7^LOBOj*} z*iie69}}h1k$8W=)`>p|iNPv1P5S}sKte**a%(atZ7yw{X4Aw*!(~tyEAMygWY6U(7%)+`~W3K)bNT-PI$nR$=KZl&vkbCE{%2S2Zb zf8$Gk05^seFu{F1F$X^Q4}O0R8sNY9!W?DtA->LqA7R&@!J=M$x_6<_NyZ6kd$Df3QNiKAL#an%sO4QdigagUYiFa6yVZ4c%TsP z&qJ%%KuQZ4jf{%@;qLyfP`D>B7zhQzCx=J5a}jo5hcQYiStM|6tc>Ow53Pw6QRd2fmuU>oJv86H>wx3_|f%1PRtOeB)BKO{{s?N)ACsRamLv*V8zpctwU7ig9i{QUy72v$rvl-vaUG9&ZW7&8h^V8O%4|+ zO6i!toke45I_ccFwFu3g8q${0F_@Io<9>0RDn2}wE47wX`&9U;3lnxI$4oVpx$E-g z-BLX6KgxK6L?%ahKo4Gg3%uaPm)?SQz0ZtW4sez9r5KaBx&aF^& zHe(_~cxb^(8E``@zL84pO@Dg_pr)>SysulIZr6s7aN6X~q4^;D9gT&@$BH!4MRZD$P&Ox@Zue)xAO5C>EU$-LS6mIsgz>G@+>vlglj9* zXfw~j;tR&)sWemgzA~l#UT7gDi2HrId0!zXnz(?=MGekkBF#Dx?(CvaLkV zU2q)W{NN@U3N*~*19RGGxWW016 z1bw|uePeeOzITHrvFkPzK?7c0r?EGZU9&15tj2qrP~P2?zhGyXh!IIvnn_A~Qx~LJ zP{FxeT1dd>veN-=MJTP9$aH9gR@=p^1->fTOj0TuKkdl(b)DaTZClC>JRE zc#C{O2RBmZ4qFPt9Pj(_-W{mpj97ze__EeUzOD-4QGD(O4euc<#9T5bRCz{k#YZ^q|m}*a<1oHXOi8d;!xg+nn#J!gA=RJs1N9H_Gv;A zjni1Kfu=X_@wrfaq{va&tCi7DXHJG4!#qjo)&VSE0h@4`v^EV@{XNomm9NwBGpy4B z4U$~j(I2yMAk7j%67N)-k3EE|x2SW&d=gH)bQcPR5i+y#rDQJ@kI;MDHav}(*aU;; zD9Jv@*<%AefniZ3l@rge(^Bf(pfQF}UWP_tl*End`9gO^ersr(=@?0U8beEop<*mC z8E40Je3jG3aUTdqaq6@ZNyYe@If3C@^rb(ES8fw&zCoULZTAVhu5aR%4f@gZ1n0IB z-(032GT*}KHK^A=sZ-%t6}I1m@&jRV`qbdWG=Yd>pCSdXCpU1uI0xjhq@R;bBC&(Y zcezjJjkMJk&8@jUCbLv562TwSy+!<+#>1er2~~QgQ>9If?^a=qq;6cj0o8?Ck!Q4K z8?V!Z delta 2597 zcmZuzdrVvB758zufO!}QU~FS-^N1ajU`lA#Chgj|yb~PQ>_8t|;l};~cbI!!-|H;x zmZ|+?nx?fW%0HVnRnwBSQZ-E@B)k*e4ovGKY1X~kD9g@wDp_MMG*EUt)**`-LHqSsl6ypOk&~(U35HEe3B2(I`s7Z<(Y!ed+e#ue- zOAT;*oXk;ijBV#rhHuP}4tC)OGvI@A{CEcT2oRF z3V%9FTCtOlSHJp{#}Z|yHO{F6*Ji&fLj}Kp;hdS`%@8`iK>>+1|?iC!CM@1t@z=|QB^hZB~GJ&Vi zh=BzVwU+n|@7UF&QMOrc-$j7IPZ&l)nMX+^wJcT~$$7lG7SfLnCw~4u1&tef`~i(Y}b8wmbOYOjX4Z7L~@Sql~&nSWJ=Q z>OBN{aXkao#T}}ylIw_@?8f+JzQ48_XCS_2B6PpmQQ?D2Y zQFDG@Owm31l|(|dnsgW_#~W8j?QN^^5dH5h=z>lHTbI~>TNfAFOvd2cy);s=*3qk zmAYE;yo1}U5O)7REK9i$ zhgQJm@{~Y;Holk4TsGO1rhxqwnsPzQMtLCf?XICtE=%ilk4dv6RH~K7hj;Py^q< zPnM~_?#G`jgQxxh3d8S`J>6hsK%oc8(APmi%8}+$r8#m4Co-@P9>k_AMAAd}-U>M2 zo3E{dzv^LfW9A@v{|T%LX{mr%PKuXgA~k;Emy#n z%lS|r!&58Z79JZrNR@mcHq0MV9V>16OzoH#NTXzSNIOu8~EV!;4hXS zU-&MqtBk4V;`)7xmOCbfAwhKr4{y?78^+m1sB0FtgJps=C8?hkg+j!geIKp@a=g%N?v?GMKmck#!~%aY>eJD z<9|bs5@G!CUQyK|^cdbAY4j|7j~BH{;2&f*KAm!hItSY$33O$k1;%k?ojxRFT)s?i XtHRI2=awN?NRqoBy&3T3a7FwN*30fe diff --git a/submodules/WallpaperResources/Sources/WallpaperResources.swift b/submodules/WallpaperResources/Sources/WallpaperResources.swift index d796c3a9fd..1ba9d78e9b 100644 --- a/submodules/WallpaperResources/Sources/WallpaperResources.swift +++ b/submodules/WallpaperResources/Sources/WallpaperResources.swift @@ -11,7 +11,7 @@ import PhotoResources import LocalMediaResources private func wallpaperDatas(account: Account, accountManager: AccountManager, fileReference: FileMediaReference? = nil, representations: [ImageRepresentationWithReference], alwaysShowThumbnailFirst: Bool = false, thumbnail: Bool = false, autoFetchFullSize: Bool = false, synchronousLoad: Bool = false) -> Signal<(Data?, Data?, Bool), NoError> { - if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.index(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.index(where: { $0.representation == largestRepresentation }) { + if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.firstIndex(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.firstIndex(where: { $0.representation == largestRepresentation }) { let maybeFullSize: Signal if thumbnail, let file = fileReference?.media { @@ -284,7 +284,7 @@ public enum PatternWallpaperDrawMode { } private func patternWallpaperDatas(account: Account, accountManager: AccountManager, representations: [ImageRepresentationWithReference], mode: PatternWallpaperDrawMode, autoFetchFullSize: Bool = false) -> Signal<(Data?, Data?, Bool), NoError> { - if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.index(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.index(where: { $0.representation == largestRepresentation }) { + if let smallestRepresentation = smallestImageRepresentation(representations.map({ $0.representation })), let largestRepresentation = largestImageRepresentation(representations.map({ $0.representation })), let smallestIndex = representations.firstIndex(where: { $0.representation == smallestRepresentation }), let largestIndex = representations.firstIndex(where: { $0.representation == largestRepresentation }) { let size: CGSize? switch mode { diff --git a/submodules/WatchBridge/Sources/WatchRequestHandlers.swift b/submodules/WatchBridge/Sources/WatchRequestHandlers.swift index 3ff1d5fe49..5cf315186e 100644 --- a/submodules/WatchBridge/Sources/WatchRequestHandlers.swift +++ b/submodules/WatchBridge/Sources/WatchRequestHandlers.swift @@ -379,6 +379,8 @@ final class WatchMediaHandler: WatchRequestHandler { round = true case .large: targetSize = CGSize(width: 150, height: 150); + @unknown default: + fatalError() } return SSignal { subscriber in diff --git a/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift b/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift index 2b01d9e13c..c10344cfd0 100644 --- a/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift +++ b/submodules/WebSearchUI/Sources/WebSearchControllerNode.swift @@ -618,20 +618,15 @@ class WebSearchControllerNode: ASDisplayNode { } private func dequeueTransition() { - if let (transition, firstTime) = self.enqueuedTransitions.first { + if let (transition, _) = self.enqueuedTransitions.first { self.enqueuedTransitions.remove(at: 0) - let completion: (GridNodeDisplayedItemRange) -> Void = { [weak self] visibleRange in - if let strongSelf = self { - } - } - if let state = self.webSearchInterfaceState.state { self.recentQueriesNode.isHidden = !state.query.isEmpty } self.hasMore = transition.hasMore - self.gridNode.transaction(GridNodeTransaction(deleteItems: transition.deleteItems, insertItems: transition.insertItems, updateItems: transition.updateItems, scrollToItem: nil, updateLayout: nil, itemTransition: .immediate, stationaryItems: .none, updateFirstIndexInSectionOffset: nil, synchronousLoads: true), completion: completion) + self.gridNode.transaction(GridNodeTransaction(deleteItems: transition.deleteItems, insertItems: transition.insertItems, updateItems: transition.updateItems, scrollToItem: nil, updateLayout: nil, itemTransition: .immediate, stationaryItems: .none, updateFirstIndexInSectionOffset: nil, synchronousLoads: true), completion: { _ in }) } }