From 9c3a6d0506c8d7d68cb376ef4d29fda67de236e4 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 3 Apr 2024 13:08:41 +0400 Subject: [PATCH 1/5] Cherry-pick various fixes --- .../Sources/ChannelStatsController.swift | 15 +- .../Sources/MonetizationBalanceItem.swift | 48 +- .../Sources/MonetizationIntroScreen.swift | 23 +- .../Sources/StatsOverviewItem.swift | 124 ++-- .../Sources/TransactionInfoScreen.swift | 19 +- .../TelegramEngine/Messages/AdMessages.swift | 11 +- .../ChatMessageAttachedContentNode.swift | 9 +- .../ChatMessageWebpageBubbleContentNode.swift | 3 + .../MonetizationLogo.imageset/Contents.json | 2 +- .../monetization_90 (2).pdf | 323 ++++++++++ .../monetization_90.pdf | 188 ------ .../Ads/Ton.imageset/Contents.json | 12 + .../Ads/Ton.imageset/smallton.pdf | 121 ++++ .../Ads/TonAbout.imageset/Contents.json | 12 + .../Ads/TonAbout.imageset/tonabout.pdf | 130 +++++ .../Ads/TonBig.imageset/Contents.json | 12 + .../Ads/TonBig.imageset/bigton.pdf | 125 ++++ .../Ads/TonMedium.imageset/Contents.json | 12 + .../Ads/TonMedium.imageset/mediumton.pdf | 121 ++++ .../Ads/Withdrawal.imageset/Contents.json | 2 +- .../Ads/Withdrawal.imageset/ton_30.pdf | 117 ---- .../Withdrawal.imageset/withdrawals_30.pdf | 550 ++++++++++++++++++ .../ChatInterfaceStateContextMenus.swift | 88 +-- 23 files changed, 1607 insertions(+), 460 deletions(-) create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90 (2).pdf delete mode 100644 submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90.pdf create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/Contents.json create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/smallton.pdf create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/Contents.json create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/tonabout.pdf create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/Contents.json create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/bigton.pdf create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/Contents.json create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/mediumton.pdf delete mode 100644 submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/ton_30.pdf create mode 100644 submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/withdrawals_30.pdf diff --git a/submodules/StatisticsUI/Sources/ChannelStatsController.swift b/submodules/StatisticsUI/Sources/ChannelStatsController.swift index 28fdc97dc7..76c6b5157f 100644 --- a/submodules/StatisticsUI/Sources/ChannelStatsController.swift +++ b/submodules/StatisticsUI/Sources/ChannelStatsController.swift @@ -961,12 +961,11 @@ private enum StatsEntry: ItemListNodeEntry { }) case let .adsProceedsOverview(_, stats, animatedEmoji): return StatsOverviewItem(context: arguments.context, presentationData: presentationData, isGroup: false, stats: stats, animatedEmoji: animatedEmoji, sectionId: self.section, style: .blocks) - case let .adsBalance(_, stats, canWithdraw, isEnabled, animatedEmoji): + case let .adsBalance(_, stats, canWithdraw, isEnabled, _): return MonetizationBalanceItem( context: arguments.context, presentationData: presentationData, stats: stats, - animatedEmoji: animatedEmoji, canWithdraw: canWithdraw, isEnabled: isEnabled, withdrawAction: { @@ -1014,9 +1013,13 @@ private enum StatsEntry: ItemListNodeEntry { title = NSAttributedString(string: presentationData.strings.Monetization_Transaction_Refund, font: font, textColor: theme.list.itemPrimaryTextColor) detailText = stringForMediumCompactDate(timestamp: date, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat) } - + let label = amountAttributedString(formatBalanceText(transaction.amount, decimalSeparator: presentationData.dateTimeFormat.decimalSeparator, showPlus: true), integralFont: font, fractionalFont: smallLabelFont, color: labelColor).mutableCopy() as! NSMutableAttributedString - label.append(NSAttributedString(string: " TON", font: smallLabelFont, textColor: labelColor)) + label.insert(NSAttributedString(string: " $ ", font: font, textColor: labelColor), at: 1) + if let range = label.string.range(of: "$"), let icon = generateTintedImage(image: UIImage(bundleImageName: "Ads/TonMedium"), color: labelColor) { + label.addAttribute(.attachment, value: icon, range: NSRange(range, in: label.string)) + label.addAttribute(.baselineOffset, value: 1.0, range: NSRange(range, in: label.string)) + } return ItemListDisclosureItem(presentationData: presentationData, title: "", attributedTitle: title, label: "", attributedLabel: label, labelStyle: .coloredText(labelColor), additionalDetailLabel: detailText, additionalDetailLabelColor: detailColor, sectionId: self.section, style: .blocks, disclosureStyle: .none, action: { arguments.openTransaction(transaction) @@ -1378,13 +1381,13 @@ private func monetizationEntries( var entries: [StatsEntry] = [] entries.append(.adsHeader(presentationData.theme, presentationData.strings.Monetization_Header)) - entries.append(.adsImpressionsTitle(presentationData.theme, presentationData.strings.Monetization_ImpressionsTitle)) if !data.topHoursGraph.isEmpty { + entries.append(.adsImpressionsTitle(presentationData.theme, presentationData.strings.Monetization_ImpressionsTitle)) entries.append(.adsImpressionsGraph(presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, data.topHoursGraph, .hourlyStep)) } - entries.append(.adsRevenueTitle(presentationData.theme, presentationData.strings.Monetization_AdRevenueTitle)) if !data.revenueGraph.isEmpty { + entries.append(.adsRevenueTitle(presentationData.theme, presentationData.strings.Monetization_AdRevenueTitle)) entries.append(.adsRevenueGraph(presentationData.theme, presentationData.strings, presentationData.dateTimeFormat, data.revenueGraph, .currency, data.usdRate)) } diff --git a/submodules/StatisticsUI/Sources/MonetizationBalanceItem.swift b/submodules/StatisticsUI/Sources/MonetizationBalanceItem.swift index d267e42734..a21ddae005 100644 --- a/submodules/StatisticsUI/Sources/MonetizationBalanceItem.swift +++ b/submodules/StatisticsUI/Sources/MonetizationBalanceItem.swift @@ -8,14 +8,12 @@ import TelegramPresentationData import ItemListUI import SolidRoundedButtonNode import TelegramCore -import EmojiTextAttachmentView import TextFormat final class MonetizationBalanceItem: ListViewItem, ItemListItem { let context: AccountContext let presentationData: ItemListPresentationData let stats: RevenueStats - let animatedEmoji: TelegramMediaFile? let canWithdraw: Bool let isEnabled: Bool let withdrawAction: () -> Void @@ -26,7 +24,6 @@ final class MonetizationBalanceItem: ListViewItem, ItemListItem { context: AccountContext, presentationData: ItemListPresentationData, stats: RevenueStats, - animatedEmoji: TelegramMediaFile?, canWithdraw: Bool, isEnabled: Bool, withdrawAction: @escaping () -> Void, @@ -36,7 +33,6 @@ final class MonetizationBalanceItem: ListViewItem, ItemListItem { self.context = context self.presentationData = presentationData self.stats = stats - self.animatedEmoji = animatedEmoji self.canWithdraw = canWithdraw self.isEnabled = isEnabled self.withdrawAction = withdrawAction @@ -86,7 +82,7 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode { private let bottomStripeNode: ASDisplayNode private let maskNode: ASImageNode - private var animatedEmojiLayer: InlineStickerItemLayer? + private let iconNode: ASImageNode private let balanceTextNode: TextNode private let valueTextNode: TextNode @@ -117,6 +113,10 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode { self.bottomStripeNode = ASDisplayNode() self.bottomStripeNode.isLayerBacked = true + self.iconNode = ASImageNode() + self.iconNode.isUserInteractionEnabled = false + self.iconNode.displaysAsynchronously = false + self.balanceTextNode = TextNode() self.balanceTextNode.isUserInteractionEnabled = false self.balanceTextNode.displaysAsynchronously = false @@ -129,6 +129,7 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode { super.init(layerBacked: false, dynamicBounce: false) + self.addSubnode(self.iconNode) self.addSubnode(self.balanceTextNode) self.addSubnode(self.valueTextNode) } @@ -197,6 +198,7 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode { return (ListViewItemNodeLayout(contentSize: contentSize, insets: insets), { [weak self] in if let strongSelf = self { + let themeUpdated = strongSelf.item?.presentationData.theme !== item.presentationData.theme strongSelf.item = item let _ = balanceApply() @@ -269,32 +271,20 @@ final class MonetizationBalanceItemNode: ListViewItemNode, ItemListItemNode { strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: bottomStripeInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - bottomStripeInset, height: separatorHeight)) } - var emojiItemFrame: CGRect = .zero - var emojiItemSize: CGFloat = 0.0 - if let animatedEmoji = item.animatedEmoji { - emojiItemSize = floorToScreenPixels(46.0 * 20.0 / 17.0) - - emojiItemFrame = CGRect(origin: CGPoint(x: -emojiItemSize / 2.0 - 5.0, y: -3.0), size: CGSize()).insetBy(dx: -emojiItemSize / 2.0, dy: -emojiItemSize / 2.0) - emojiItemFrame.origin.x = floorToScreenPixels(emojiItemFrame.origin.x) - emojiItemFrame.origin.y = floorToScreenPixels(emojiItemFrame.origin.y) - - let itemLayer: InlineStickerItemLayer - if let current = strongSelf.animatedEmojiLayer { - itemLayer = current - } else { - let pointSize = floor(emojiItemSize * 1.3) - itemLayer = InlineStickerItemLayer(context: item.context, userLocation: .other, attemptSynchronousLoad: true, emoji: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: animatedEmoji.fileId.id, file: animatedEmoji, custom: nil), file: animatedEmoji, cache: item.context.animationCache, renderer: item.context.animationRenderer, placeholderColor: item.presentationData.theme.list.mediaPlaceholderColor, pointSize: CGSize(width: pointSize, height: pointSize), dynamicColor: nil) - strongSelf.animatedEmojiLayer = itemLayer - strongSelf.layer.addSublayer(itemLayer) - - itemLayer.isVisibleForAnimations = true - } + if themeUpdated { + strongSelf.iconNode.image = generateTintedImage(image: UIImage(bundleImageName: "Ads/TonBig"), color: item.presentationData.theme.list.itemAccentColor) } - - let balanceTotalWidth: CGFloat = emojiItemSize + balanceLayout.size.width - let balanceTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((params.width - balanceTotalWidth) / 2.0) + emojiItemSize, y: verticalInset), size: balanceLayout.size) + + var emojiItemSize = CGSize() + if let icon = strongSelf.iconNode.image { + emojiItemSize = icon.size + } + + let balanceTotalWidth: CGFloat = emojiItemSize.width + balanceLayout.size.width + let balanceTextFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((params.width - balanceTotalWidth) / 2.0) + emojiItemSize.width, y: verticalInset), size: balanceLayout.size) strongSelf.balanceTextNode.frame = balanceTextFrame - strongSelf.animatedEmojiLayer?.frame = emojiItemFrame.offsetBy(dx: balanceTextFrame.minX, dy: balanceTextFrame.midY) + + strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: balanceTextFrame.minX - emojiItemSize.width - 7.0, y: floorToScreenPixels(balanceTextFrame.midY - emojiItemSize.height / 2.0) - 3.0), size: emojiItemSize) strongSelf.valueTextNode.frame = CGRect(origin: CGPoint(x: floorToScreenPixels((params.width - valueLayout.size.width) / 2.0), y: balanceTextFrame.maxY - 5.0), size: valueLayout.size) diff --git a/submodules/StatisticsUI/Sources/MonetizationIntroScreen.swift b/submodules/StatisticsUI/Sources/MonetizationIntroScreen.swift index d7faca7461..31db7b01ed 100644 --- a/submodules/StatisticsUI/Sources/MonetizationIntroScreen.swift +++ b/submodules/StatisticsUI/Sources/MonetizationIntroScreen.swift @@ -12,7 +12,6 @@ import SheetComponent import BundleIconComponent import BalancedTextComponent import MultilineTextComponent -import MultilineTextWithEntitiesComponent import SolidRoundedButtonComponent import LottieComponent import AccountContext @@ -44,6 +43,7 @@ private final class SheetContent: CombinedComponent { final class State: ComponentState { var cachedIconImage: (UIImage, PresentationTheme)? var cachedChevronImage: (UIImage, PresentationTheme)? + var cachedTonImage: (UIImage, PresentationTheme)? let playOnce = ActionSlot() private var didPlayAnimation = false @@ -70,7 +70,7 @@ private final class SheetContent: CombinedComponent { let actionButton = Child(SolidRoundedButtonComponent.self) let infoBackground = Child(RoundedRectangle.self) - let infoTitle = Child(MultilineTextWithEntitiesComponent.self) + let infoTitle = Child(MultilineTextComponent.self) let infoText = Child(MultilineTextComponent.self) let spaceRegex = try? NSRegularExpression(pattern: "\\[(.*?)\\]", options: []) @@ -202,18 +202,20 @@ private final class SheetContent: CombinedComponent { contentSize.height += list.size.height contentSize.height += spacing - 13.0 - let infoTitleString = strings.Monetization_Intro_Info_Title + if state.cachedTonImage == nil || state.cachedTonImage?.1 !== environment.theme { + state.cachedTonImage = (generateTintedImage(image: UIImage(bundleImageName: "Ads/TonAbout"), color: linkColor)!, theme) + } + + let infoTitleString = strings.Monetization_Intro_Info_Title.replacingOccurrences(of: "#", with: " # ") let infoTitleAttributedString = NSMutableAttributedString(string: infoTitleString, font: titleFont, textColor: textColor) let range = (infoTitleAttributedString.string as NSString).range(of: "#") - if range.location != NSNotFound, let emojiFile = component.context.animatedEmojiStickersValue["💎"]?.first?.file { - infoTitleAttributedString.addAttribute(ChatTextInputAttributes.customEmoji, value: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: emojiFile.fileId.id, file: emojiFile), range: range) + if range.location != NSNotFound, let icon = state.cachedTonImage?.0 { + infoTitleAttributedString.addAttribute(.attachment, value: icon, range: range) + infoTitleAttributedString.addAttribute(.foregroundColor, value: linkColor, range: range) + infoTitleAttributedString.addAttribute(.baselineOffset, value: 1.0, range: range) } let infoTitle = infoTitle.update( - component: MultilineTextWithEntitiesComponent( - context: component.context, - animationCache: component.context.animationCache, - animationRenderer: component.context.animationRenderer, - placeholderColor: environment.theme.list.mediaPlaceholderColor, + component: MultilineTextComponent( text: .plain(infoTitleAttributedString), horizontalAlignment: .center ), @@ -244,6 +246,7 @@ private final class SheetContent: CombinedComponent { let infoAttributedString = parseMarkdownIntoAttributedString(infoString, attributes: markdownAttributes).mutableCopy() as! NSMutableAttributedString if let range = infoAttributedString.string.range(of: ">"), let chevronImage = state.cachedChevronImage?.0 { infoAttributedString.addAttribute(.attachment, value: chevronImage, range: NSRange(range, in: infoAttributedString.string)) + infoAttributedString.addAttribute(.baselineOffset, value: 1.0, range: NSRange(range, in: infoAttributedString.string)) } let infoText = infoText.update( component: MultilineTextComponent( diff --git a/submodules/StatisticsUI/Sources/StatsOverviewItem.swift b/submodules/StatisticsUI/Sources/StatsOverviewItem.swift index 844a69533b..2c7d87d783 100644 --- a/submodules/StatisticsUI/Sources/StatsOverviewItem.swift +++ b/submodules/StatisticsUI/Sources/StatsOverviewItem.swift @@ -108,16 +108,16 @@ private final class ValueItemNode: ASDisplayNode { private let valueNode: TextNode private let titleNode: TextNode private let deltaNode: TextNode - private var animatedEmojiLayer: InlineStickerItemLayer? + private var iconNode: ASImageNode? - var currentBackgroundColor: UIColor? + var currentTheme: PresentationTheme? var pressed: (() -> Void)? override init() { self.valueNode = TextNode() self.titleNode = TextNode() self.deltaNode = TextNode() - + super.init() self.isUserInteractionEnabled = false @@ -127,13 +127,13 @@ private final class ValueItemNode: ASDisplayNode { self.addSubnode(self.deltaNode) } - static func asyncLayout(_ current: ValueItemNode?) -> (_ context: AccountContext, _ width: CGFloat, _ presentationData: ItemListPresentationData, _ value: String, _ title: String, _ delta: (String, DeltaColor)?, _ animatedEmoji: TelegramMediaFile?) -> (CGSize, () -> ValueItemNode) { + static func asyncLayout(_ current: ValueItemNode?) -> (_ context: AccountContext, _ width: CGFloat, _ presentationData: ItemListPresentationData, _ value: String, _ title: String, _ delta: (String, DeltaColor)?, _ isTon: Bool) -> (CGSize, () -> ValueItemNode) { let maybeMakeValueLayout = (current?.valueNode).flatMap(TextNode.asyncLayout) let maybeMakeTitleLayout = (current?.titleNode).flatMap(TextNode.asyncLayout) let maybeMakeDeltaLayout = (current?.deltaNode).flatMap(TextNode.asyncLayout) - return { context, width, presentationData, value, title, delta, animatedEmoji in + return { context, width, presentationData, value, title, delta, isTon in let targetNode: ValueItemNode if let current = current { targetNode = current @@ -164,6 +164,7 @@ private final class ValueItemNode: ASDisplayNode { let fontSize = presentationData.fontSize.itemListBaseFontSize let valueFont = Font.semibold(fontSize) + let smallValueFont = Font.semibold(fontSize / 17.0 * 13.0) let titleFont = Font.regular(presentationData.fontSize.itemListBaseHeaderFontSize) let deltaFont = Font.regular(presentationData.fontSize.itemListBaseHeaderFontSize) @@ -183,10 +184,17 @@ private final class ValueItemNode: ASDisplayNode { } else { deltaColor = presentationData.theme.list.freeTextErrorColor } - let placeholderColor = presentationData.theme.list.mediaPlaceholderColor let constrainedSize = CGSize(width: width, height: CGFloat.greatestFiniteMagnitude) - let (valueLayout, valueApply) = makeValueLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: value, font: valueFont, textColor: valueColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: constrainedSize, alignment: .natural, cutout: nil, insets: UIEdgeInsets())) + + let valueString: NSAttributedString + if isTon { + valueString = amountAttributedString(value, integralFont: valueFont, fractionalFont: smallValueFont, color: valueColor) + } else { + valueString = NSAttributedString(string: value, font: valueFont, textColor: valueColor) + } + + let (valueLayout, valueApply) = makeValueLayout(TextNodeLayoutArguments(attributedString: valueString, backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: constrainedSize, alignment: .natural, cutout: nil, insets: UIEdgeInsets())) let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: NSAttributedString(string: title, font: titleFont, textColor: titleColor), backgroundColor: nil, maximumNumberOfLines: 1, truncationType: .end, constrainedSize: constrainedSize, alignment: .natural, cutout: nil, insets: UIEdgeInsets())) @@ -195,34 +203,43 @@ private final class ValueItemNode: ASDisplayNode { let horizontalSpacing: CGFloat = 4.0 let size = CGSize(width: valueLayout.size.width + horizontalSpacing + deltaLayout.size.width, height: valueLayout.size.height + titleLayout.size.height) return (size, { + var themeUpdated = false + if targetNode.currentTheme !== presentationData.theme { + themeUpdated = true + } + targetNode.currentTheme = presentationData.theme + let _ = valueApply() let _ = titleApply() let _ = deltaApply() var valueOffset: CGFloat = 0.0 - if let animatedEmoji { - let itemSize = floorToScreenPixels(fontSize * 20.0 / 17.0) - - var itemFrame = CGRect(origin: CGPoint(x: itemSize / 2.0 - 1.0, y: itemSize / 2.0), size: CGSize()).insetBy(dx: -itemSize / 2.0, dy: -itemSize / 2.0) - itemFrame.origin.x = floorToScreenPixels(itemFrame.origin.x) - itemFrame.origin.y = floorToScreenPixels(itemFrame.origin.y) - - let itemLayer: InlineStickerItemLayer - if let current = targetNode.animatedEmojiLayer { - itemLayer = current + if isTon { + let iconNode: ASImageNode + if let current = targetNode.iconNode { + iconNode = current } else { - let pointSize = floor(itemSize * 1.3) - itemLayer = InlineStickerItemLayer(context: context, userLocation: .other, attemptSynchronousLoad: true, emoji: ChatTextInputTextCustomEmojiAttribute(interactivelySelectedFromPackId: nil, fileId: animatedEmoji.fileId.id, file: animatedEmoji, custom: nil), file: animatedEmoji, cache: context.animationCache, renderer: context.animationRenderer, placeholderColor: placeholderColor, pointSize: CGSize(width: pointSize, height: pointSize), dynamicColor: nil) - targetNode.animatedEmojiLayer = itemLayer - targetNode.layer.addSublayer(itemLayer) - - itemLayer.isVisibleForAnimations = true + iconNode = ASImageNode() + iconNode.displaysAsynchronously = false + targetNode.iconNode = iconNode + targetNode.addSubnode(iconNode) } - valueOffset += 22.0 - itemLayer.frame = itemFrame + if themeUpdated { + iconNode.image = generateTintedImage(image: UIImage(bundleImageName: "Ads/TonMedium"), color: presentationData.theme.list.itemAccentColor) + } + + if let icon = iconNode.image { + let iconFrame = CGRect(origin: CGPoint(x: 0.0, y: floorToScreenPixels((valueLayout.size.height - icon.size.height) / 2.0) - 1.0), size: icon.size) + iconNode.frame = iconFrame + } + + valueOffset += 17.0 + } else if let iconNode = targetNode.iconNode { + iconNode.removeFromSupernode() + targetNode.iconNode = nil } - + let valueFrame = CGRect(origin: CGPoint(x: valueOffset, y: 0.0), size: valueLayout.size) let titleFrame = CGRect(origin: CGPoint(x: 0.0, y: valueFrame.maxY), size: titleLayout.size) let deltaFrame = CGRect(origin: CGPoint(x: valueFrame.maxX + horizontalSpacing, y: valueFrame.maxY - deltaLayout.size.height - 2.0 - UIScreenPixel), size: deltaLayout.size) @@ -365,7 +382,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(stats.views), item.presentationData.strings.Stats_Message_Views, nil, - nil + false ) topRightItemLayoutAndApply = makeTopRightItemLayout( @@ -375,7 +392,7 @@ class StatsOverviewItemNode: ListViewItemNode { item.publicShares.flatMap { compactNumericCountString(Int($0)) } ?? "–", item.presentationData.strings.Stats_Message_PublicShares, nil, - nil + false ) middle1LeftItemLayoutAndApply = makeMiddle1LeftItemLayout( @@ -385,7 +402,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(stats.reactions), item.presentationData.strings.Stats_Message_Reactions, nil, - nil + false ) middle1RightItemLayoutAndApply = makeMiddle1RightItemLayout( @@ -395,7 +412,7 @@ class StatsOverviewItemNode: ListViewItemNode { item.publicShares.flatMap { "≈\( compactNumericCountString(max(0, stats.forwards - Int($0))))" } ?? "–", item.presentationData.strings.Stats_Message_PrivateShares, nil, - nil + false ) height += topRightItemLayoutAndApply!.0.height * 2.0 + verticalSpacing @@ -407,7 +424,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(views.seenCount), item.presentationData.strings.Stats_Message_Views, nil, - nil + false ) topRightItemLayoutAndApply = makeTopRightItemLayout( @@ -417,7 +434,7 @@ class StatsOverviewItemNode: ListViewItemNode { item.publicShares.flatMap { compactNumericCountString(Int($0)) } ?? "–", item.presentationData.strings.Stats_Message_PublicShares, nil, - nil + false ) middle1LeftItemLayoutAndApply = makeMiddle1LeftItemLayout( @@ -427,7 +444,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(views.reactedCount), item.presentationData.strings.Stats_Message_Reactions, nil, - nil + false ) middle1RightItemLayoutAndApply = makeMiddle1RightItemLayout( @@ -437,7 +454,7 @@ class StatsOverviewItemNode: ListViewItemNode { item.publicShares.flatMap { "≈\( compactNumericCountString(max(0, views.forwardCount - Int($0))))" } ?? "–", item.presentationData.strings.Stats_Message_PrivateShares, nil, - nil + false ) height += topRightItemLayoutAndApply!.0.height * 2.0 + verticalSpacing @@ -449,7 +466,7 @@ class StatsOverviewItemNode: ListViewItemNode { "\(stats.level)", item.presentationData.strings.Stats_Boosts_Level, nil, - nil + false ) var premiumSubscribers: Double = 0.0 @@ -464,7 +481,7 @@ class StatsOverviewItemNode: ListViewItemNode { "≈\(Int(stats.premiumAudience?.value ?? 0))", item.isGroup ? item.presentationData.strings.Stats_Boosts_PremiumMembers : item.presentationData.strings.Stats_Boosts_PremiumSubscribers, (String(format: "%.02f%%", premiumSubscribers * 100.0), .generic), - nil + false ) middle1LeftItemLayoutAndApply = makeMiddle1LeftItemLayout( @@ -474,7 +491,7 @@ class StatsOverviewItemNode: ListViewItemNode { "\(stats.boosts)", item.presentationData.strings.Stats_Boosts_ExistingBoosts, nil, - nil + false ) let boostsLeft: Int32 @@ -490,7 +507,7 @@ class StatsOverviewItemNode: ListViewItemNode { "\(boostsLeft)", item.presentationData.strings.Stats_Boosts_BoostsToLevelUp, nil, - nil + false ) if twoColumnLayout { @@ -515,7 +532,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(Int(stats.followers.current)), item.presentationData.strings.Stats_Followers, (followersDelta.text, followersDelta.positive ? .positive : .negative), - nil + false ) var enabledNotifications: Double = 0.0 @@ -529,7 +546,7 @@ class StatsOverviewItemNode: ListViewItemNode { String(format: "%.02f%%", enabledNotifications * 100.0), item.presentationData.strings.Stats_EnabledNotifications, nil, - nil + false ) let hasMessages = stats.viewsPerPost.current > 0 || viewsPerPostDelta.hasValue @@ -588,7 +605,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } if let (value, title, delta) = items[1] { @@ -599,7 +616,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } if let (value, title, delta) = items[2] { @@ -610,7 +627,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } if let (value, title, delta) = items[3] { @@ -621,7 +638,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } if let (value, title, delta) = items[4] { @@ -632,7 +649,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } if let (value, title, delta) = items[5] { @@ -643,7 +660,7 @@ class StatsOverviewItemNode: ListViewItemNode { value, title, delta, - nil + false ) } @@ -667,7 +684,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(Int(stats.members.current)), item.presentationData.strings.Stats_GroupMembers, (membersDelta.text, membersDelta.positive ? .positive : .negative), - nil + false ) let messagesDelta = deltaText(stats.messages) @@ -678,7 +695,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(Int(stats.messages.current)), item.presentationData.strings.Stats_GroupMessages, (messagesDelta.text, messagesDelta.positive ? .positive : .negative), - nil + false ) if displayBottomRow { @@ -689,7 +706,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(Int(stats.viewers.current)), item.presentationData.strings.Stats_GroupViewers, (viewersDelta.text, viewersDelta.positive ? .positive : .negative), - nil + false ) middle1RightItemLayoutAndApply = makeMiddle1RightItemLayout( @@ -699,7 +716,7 @@ class StatsOverviewItemNode: ListViewItemNode { compactNumericCountString(Int(stats.posters.current)), item.presentationData.strings.Stats_GroupPosters, (postersDelta.text, postersDelta.positive ? .positive : .negative), - nil + false ) } @@ -711,7 +728,6 @@ class StatsOverviewItemNode: ListViewItemNode { } else if let stats = item.stats as? RevenueStats { twoColumnLayout = false - topLeftItemLayoutAndApply = makeTopLeftItemLayout( item.context, params.width, @@ -719,7 +735,7 @@ class StatsOverviewItemNode: ListViewItemNode { formatBalanceText(stats.availableBalance, decimalSeparator: item.presentationData.dateTimeFormat.decimalSeparator), item.presentationData.strings.Monetization_Overview_Available, (stats.availableBalance == 0 ? "" : "≈\(formatUsdValue(stats.availableBalance, rate: stats.usdRate))", .generic), - item.animatedEmoji + true ) topRightItemLayoutAndApply = makeTopRightItemLayout( @@ -729,7 +745,7 @@ class StatsOverviewItemNode: ListViewItemNode { formatBalanceText(stats.currentBalance, decimalSeparator: item.presentationData.dateTimeFormat.decimalSeparator), item.presentationData.strings.Monetization_Overview_Current, (stats.currentBalance == 0 ? "" : "≈\(formatUsdValue(stats.currentBalance, rate: stats.usdRate))", .generic), - item.animatedEmoji + true ) middle1LeftItemLayoutAndApply = makeMiddle1LeftItemLayout( @@ -739,7 +755,7 @@ class StatsOverviewItemNode: ListViewItemNode { formatBalanceText(stats.overallRevenue, decimalSeparator: item.presentationData.dateTimeFormat.decimalSeparator), item.presentationData.strings.Monetization_Overview_Total, (stats.overallRevenue == 0 ? "" : "≈\(formatUsdValue(stats.overallRevenue, rate: stats.usdRate))", .generic), - item.animatedEmoji + true ) height += topLeftItemLayoutAndApply!.0.height * 3.0 + verticalSpacing * 2.0 diff --git a/submodules/StatisticsUI/Sources/TransactionInfoScreen.swift b/submodules/StatisticsUI/Sources/TransactionInfoScreen.swift index 90688d1893..75831f8185 100644 --- a/submodules/StatisticsUI/Sources/TransactionInfoScreen.swift +++ b/submodules/StatisticsUI/Sources/TransactionInfoScreen.swift @@ -133,20 +133,21 @@ private final class SheetContent: CombinedComponent { let integralFont = Font.with(size: 48.0, design: .round, weight: .semibold) let fractionalFont = Font.with(size: 24.0, design: .round, weight: .semibold) + let labelColor: UIColor var showPeer = false switch component.transaction { case let .proceeds(amount, fromDate, toDate): - amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator, showPlus: true), integralFont: integralFont, fractionalFont: fractionalFont, color: theme.list.itemDisclosureActions.constructive.fillColor).mutableCopy() as! NSMutableAttributedString - amountString.append(NSAttributedString(string: " TON", font: fractionalFont, textColor: theme.list.itemDisclosureActions.constructive.fillColor)) + labelColor = theme.list.itemDisclosureActions.constructive.fillColor + amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator, showPlus: true), integralFont: integralFont, fractionalFont: fractionalFont, color: labelColor).mutableCopy() as! NSMutableAttributedString dateString = "\(stringForMediumCompactDate(timestamp: fromDate, strings: strings, dateTimeFormat: dateTimeFormat)) – \(stringForMediumCompactDate(timestamp: toDate, strings: strings, dateTimeFormat: dateTimeFormat))" titleString = strings.Monetization_TransactionInfo_Proceeds buttonTitle = strings.Common_OK explorerUrl = nil showPeer = true case let .withdrawal(status, amount, date, provider, _, transactionUrl): - amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator), integralFont: integralFont, fractionalFont: fractionalFont, color: theme.list.itemDestructiveColor).mutableCopy() as! NSMutableAttributedString - amountString.append(NSAttributedString(string: " TON", font: fractionalFont, textColor: theme.list.itemDestructiveColor)) + labelColor = theme.list.itemDestructiveColor + amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator), integralFont: integralFont, fractionalFont: fractionalFont, color: labelColor).mutableCopy() as! NSMutableAttributedString dateString = stringForFullDate(timestamp: date, strings: strings, dateTimeFormat: dateTimeFormat) switch status { @@ -163,14 +164,20 @@ private final class SheetContent: CombinedComponent { } explorerUrl = transactionUrl case let .refund(amount, date, _): + labelColor = theme.list.itemDisclosureActions.constructive.fillColor titleString = strings.Monetization_TransactionInfo_Refund - amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator, showPlus: true), integralFont: integralFont, fractionalFont: fractionalFont, color: theme.list.itemDisclosureActions.constructive.fillColor).mutableCopy() as! NSMutableAttributedString - amountString.append(NSAttributedString(string: " TON", font: fractionalFont, textColor: theme.list.itemDisclosureActions.constructive.fillColor)) + amountString = amountAttributedString(formatBalanceText(amount, decimalSeparator: dateTimeFormat.decimalSeparator, showPlus: true), integralFont: integralFont, fractionalFont: fractionalFont, color: labelColor).mutableCopy() as! NSMutableAttributedString dateString = stringForFullDate(timestamp: date, strings: strings, dateTimeFormat: dateTimeFormat) buttonTitle = strings.Common_OK explorerUrl = nil } + amountString.insert(NSAttributedString(string: " $ ", font: integralFont, textColor: labelColor), at: 1) + if let range = amountString.string.range(of: "$"), let icon = generateTintedImage(image: UIImage(bundleImageName: "Ads/TonBig"), color: labelColor) { + amountString.addAttribute(.attachment, value: icon, range: NSRange(range, in: amountString.string)) + amountString.addAttribute(.baselineOffset, value: 1.0, range: NSRange(range, in: amountString.string)) + } + let amount = amount.update( component: MultilineTextComponent( text: .plain(amountString), diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift index 5ae2763d04..83ad6be77b 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift @@ -326,7 +326,7 @@ private class AdMessagesHistoryContextImpl { case .recommended: mappedMessageType = .recommended } - attributes.append(AdMessageAttribute(opaqueId: self.opaqueId, messageType: mappedMessageType, displayAvatar: self.displayAvatar, target: target, buttonText: self.buttonText, sponsorInfo: self.sponsorInfo, additionalInfo: self.additionalInfo, canReport: self.canReport)) + attributes.append(AdMessageAttribute(opaqueId: self.opaqueId, messageType: mappedMessageType, displayAvatar: self.displayAvatar && !self.canReport, target: target, buttonText: self.buttonText, sponsorInfo: self.sponsorInfo, additionalInfo: self.additionalInfo, canReport: self.canReport)) if !self.textEntities.isEmpty { let attribute = TextEntitiesMessageAttribute(entities: self.textEntities) attributes.append(attribute) @@ -404,9 +404,14 @@ private class AdMessagesHistoryContextImpl { let messageStableVersion = UInt32(bitPattern: Int32(truncatingIfNeeded: messageHash)) var media: [Media] = self.media - if media.isEmpty, case let .invite(invite) = self.target, let image = invite.image { - media.append(image) + if media.isEmpty { + if case let .invite(invite) = self.target, let image = invite.image { + media.append(image) + } else if self.displayAvatar && self.canReport, let profileImage = author.smallProfileImage { + media.append(TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [profileImage], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: [])) + } } + return Message( stableId: 0, diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift index 7588b9f77d..8df70d4273 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageAttachedContentNode/Sources/ChatMessageAttachedContentNode.swift @@ -1089,7 +1089,14 @@ public final class ChatMessageAttachedContentNode: ASDisplayNode { if let (titleBadgeLayout, titleBadgeApply) = titleBadgeLayoutAndApply { let titleBadgeLabel = titleBadgeApply() - let titleBadgeFrame = CGRect(origin: CGPoint(x: titleFrame.maxX + titleBadgeSpacing + titleBadgePadding, y: floorToScreenPixels(titleFrame.midY - titleBadgeLayout.size.height / 2.0)), size: titleBadgeLayout.size) + var titleLineWidth: CGFloat = 0.0 + if let firstLine = titleLayout.linesRects().first { + titleLineWidth = firstLine.width + } else { + titleLineWidth = titleFrame.width + } + + let titleBadgeFrame = CGRect(origin: CGPoint(x: titleFrame.minX + titleLineWidth + titleBadgeSpacing + titleBadgePadding, y: floorToScreenPixels(titleFrame.midY - titleBadgeLayout.size.height / 2.0)), size: titleBadgeLayout.size) let badgeBackgroundFrame = titleBadgeFrame.insetBy(dx: -titleBadgePadding, dy: -1.0 + UIScreenPixel) let button: HighlightTrackingButtonNode diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift index 4315bccdf9..39318cae99 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift @@ -510,6 +510,9 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent break } } + if adAttribute.displayAvatar && adAttribute.canReport, let profileImage = item.message.author?.smallProfileImage { + mediaAndFlags = (TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [profileImage], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: []), [.preferMediaInline]) + } if adAttribute.canReport { titleBadge = item.presentationData.strings.Message_AdWhatIsThis diff --git a/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/Contents.json index cd3e839d6c..19784c10ca 100644 --- a/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "monetization_90.pdf", + "filename" : "monetization_90 (2).pdf", "idiom" : "universal" } ], diff --git a/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90 (2).pdf b/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90 (2).pdf new file mode 100644 index 0000000000..0ec824dd4d --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90 (2).pdf @@ -0,0 +1,323 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 24.500000 17.500000 cm +0.000000 0.000000 0.000000 scn +40.500000 12.500000 m +40.500000 10.300136 38.769405 7.944759 35.153233 6.050573 c +31.608107 4.193602 26.606647 3.000000 21.000000 3.000000 c +21.000000 0.000000 l +26.991333 0.000000 32.489872 1.268831 36.545254 3.393078 c +40.529583 5.480108 43.500000 8.624732 43.500000 12.500000 c +40.500000 12.500000 l +h +21.000000 3.000000 m +15.393353 3.000000 10.391893 4.193602 6.846768 6.050573 c +3.230593 7.944759 1.500000 10.300136 1.500000 12.500000 c +-1.500000 12.500000 l +-1.500000 8.624732 1.470417 5.480108 5.454747 3.393078 c +9.510127 1.268831 15.008667 0.000000 21.000000 0.000000 c +21.000000 3.000000 l +h +43.500000 12.500000 m +43.500000 22.500000 l +40.500000 22.500000 l +40.500000 12.500000 l +43.500000 12.500000 l +h +1.500000 12.500000 m +1.500000 22.500000 l +-1.500000 22.500000 l +-1.500000 12.500000 l +1.500000 12.500000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 24.500000 26.500000 cm +0.000000 0.000000 0.000000 scn +40.500000 12.500000 m +40.500000 10.300136 38.769405 7.944759 35.153233 6.050573 c +31.608107 4.193602 26.606647 3.000000 21.000000 3.000000 c +21.000000 0.000000 l +26.991333 0.000000 32.489872 1.268831 36.545254 3.393078 c +40.529583 5.480108 43.500000 8.624732 43.500000 12.500000 c +40.500000 12.500000 l +h +21.000000 3.000000 m +15.393353 3.000000 10.391893 4.193602 6.846768 6.050573 c +3.230593 7.944759 1.500000 10.300136 1.500000 12.500000 c +-1.500000 12.500000 l +-1.500000 8.624732 1.470417 5.480108 5.454747 3.393078 c +9.510127 1.268831 15.008667 0.000000 21.000000 0.000000 c +21.000000 3.000000 l +h +43.500000 12.500000 m +43.500000 22.500000 l +40.500000 22.500000 l +40.500000 12.500000 l +43.500000 12.500000 l +h +1.500000 12.500000 m +1.500000 22.500000 l +-1.500000 22.500000 l +-1.500000 12.500000 l +1.500000 12.500000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 24.500000 36.500000 cm +0.000000 0.000000 0.000000 scn +40.500000 12.500000 m +40.500000 10.300136 38.769405 7.944759 35.153233 6.050573 c +31.608107 4.193603 26.606647 3.000000 21.000000 3.000000 c +21.000000 0.000000 l +26.991333 0.000000 32.489872 1.268831 36.545254 3.393078 c +40.529583 5.480108 43.500000 8.624732 43.500000 12.500000 c +40.500000 12.500000 l +h +21.000000 3.000000 m +15.393353 3.000000 10.391893 4.193603 6.846768 6.050573 c +3.230593 7.944759 1.500000 10.300137 1.500000 12.500000 c +-1.500000 12.500000 l +-1.500000 8.624731 1.470417 5.480108 5.454747 3.393078 c +9.510127 1.268831 15.008667 0.000000 21.000000 0.000000 c +21.000000 3.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 24.500000 34.847900 cm +0.000000 0.000000 0.000000 scn +40.783710 20.199755 m +40.205105 20.792637 39.255428 20.804211 38.662548 20.225607 c +38.069664 19.647003 38.058090 18.697327 38.636692 18.104445 c +40.783710 20.199755 l +h +3.363308 18.104445 m +3.941912 18.697327 3.930337 19.647003 3.337455 20.225607 c +2.744573 20.804211 1.794896 20.792637 1.216293 20.199755 c +3.363308 18.104445 l +h +40.500000 14.152100 m +40.500000 11.952236 38.769405 9.596859 35.153233 7.702672 c +31.608107 5.845702 26.606647 4.652100 21.000000 4.652100 c +21.000000 1.652100 l +26.991333 1.652100 32.489872 2.920931 36.545254 5.045177 c +40.529583 7.132208 43.500000 10.276832 43.500000 14.152100 c +40.500000 14.152100 l +h +21.000000 4.652100 m +15.393353 4.652100 10.391893 5.845702 6.846768 7.702672 c +3.230593 9.596859 1.500000 11.952236 1.500000 14.152100 c +-1.500000 14.152100 l +-1.500000 10.276832 1.470417 7.132208 5.454747 5.045177 c +9.510127 2.920931 15.008667 1.652100 21.000000 1.652100 c +21.000000 4.652100 l +h +38.636692 18.104445 m +39.905075 16.804764 40.500000 15.462229 40.500000 14.152100 c +43.500000 14.152100 l +43.500000 16.442863 42.443344 18.499165 40.783710 20.199755 c +38.636692 18.104445 l +h +1.500000 14.152100 m +1.500000 15.462228 2.094926 16.804764 3.363308 18.104445 c +1.216293 20.199755 l +-0.443344 18.499165 -1.500000 16.442865 -1.500000 14.152100 c +1.500000 14.152100 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 58.500000 19.000000 cm +0.000000 0.000000 0.000000 scn +1.500000 21.000000 m +1.500000 21.828426 0.828427 22.500000 0.000000 22.500000 c +-0.828427 22.500000 -1.500000 21.828426 -1.500000 21.000000 c +1.500000 21.000000 l +h +-1.500000 3.000000 m +-1.500000 2.171574 -0.828427 1.500000 0.000000 1.500000 c +0.828427 1.500000 1.500000 2.171574 1.500000 3.000000 c +-1.500000 3.000000 l +h +-1.500000 21.000000 m +-1.500000 3.000000 l +1.500000 3.000000 l +1.500000 21.000000 l +-1.500000 21.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 32.500000 19.000000 cm +0.000000 0.000000 0.000000 scn +1.500000 21.000000 m +1.500000 21.828426 0.828427 22.500000 0.000000 22.500000 c +-0.828427 22.500000 -1.500000 21.828426 -1.500000 21.000000 c +1.500000 21.000000 l +h +-1.500000 3.000000 m +-1.500000 2.171574 -0.828427 1.500000 0.000000 1.500000 c +0.828427 1.500000 1.500000 2.171574 1.500000 3.000000 c +-1.500000 3.000000 l +h +-1.500000 21.000000 m +-1.500000 3.000000 l +1.500000 3.000000 l +1.500000 21.000000 l +-1.500000 21.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 41.500000 17.000000 cm +0.000000 0.000000 0.000000 scn +1.500000 21.000000 m +1.500000 21.828426 0.828427 22.500000 0.000000 22.500000 c +-0.828427 22.500000 -1.500000 21.828426 -1.500000 21.000000 c +1.500000 21.000000 l +h +-1.500000 3.000000 m +-1.500000 2.171574 -0.828427 1.500000 0.000000 1.500000 c +0.828427 1.500000 1.500000 2.171574 1.500000 3.000000 c +-1.500000 3.000000 l +h +-1.500000 21.000000 m +-1.500000 3.000000 l +1.500000 3.000000 l +1.500000 21.000000 l +-1.500000 21.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 50.500000 17.000000 cm +0.000000 0.000000 0.000000 scn +1.500000 21.000000 m +1.500000 21.828426 0.828427 22.500000 0.000000 22.500000 c +-0.828427 22.500000 -1.500000 21.828426 -1.500000 21.000000 c +1.500000 21.000000 l +h +-1.500000 3.000000 m +-1.500000 2.171574 -0.828427 1.500000 0.000000 1.500000 c +0.828427 1.500000 1.500000 2.171574 1.500000 3.000000 c +-1.500000 3.000000 l +h +-1.500000 21.000000 m +-1.500000 3.000000 l +1.500000 3.000000 l +1.500000 21.000000 l +-1.500000 21.000000 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 30.500000 44.000000 cm +0.000000 0.000000 0.000000 scn +15.000000 0.000000 m +23.284271 0.000000 30.000000 6.715729 30.000000 15.000000 c +30.000000 23.284271 23.284271 30.000000 15.000000 30.000000 c +6.715729 30.000000 0.000000 23.284271 0.000000 15.000000 c +0.000000 6.715729 6.715729 0.000000 15.000000 0.000000 c +h +15.048176 25.349976 m +15.421402 25.349976 15.723961 25.047417 15.723961 24.674192 c +15.723961 23.205154 l +18.095222 22.987938 19.914494 21.751314 20.472042 19.829758 c +20.527039 19.675770 20.560036 19.488785 20.560036 19.257805 c +20.560036 18.619858 20.109074 18.201893 19.471127 18.201893 c +18.877178 18.201893 18.514206 18.476870 18.261230 19.048822 c +17.722275 20.511700 16.512375 21.138649 14.928505 21.138649 c +13.069660 21.138649 11.694775 20.236723 11.694775 18.784843 c +11.694775 17.629940 12.519707 16.860004 14.576534 16.420040 c +16.303391 16.057072 l +19.636112 15.353130 21.000000 14.022240 21.000000 11.712433 c +21.000000 8.937572 18.975109 7.118385 15.723961 6.869202 c +15.723961 5.301727 l +15.723961 4.928501 15.421402 4.625942 15.048176 4.625942 c +14.674950 4.625942 14.372391 4.928501 14.372391 5.301727 c +14.372391 6.855297 l +11.601112 7.008568 9.709362 8.286453 9.131989 10.018574 c +9.054996 10.260555 9.000000 10.524532 9.000000 10.788509 c +9.000000 11.503452 9.439964 11.965412 10.110909 11.965412 c +10.671860 11.965412 11.034832 11.712433 11.276810 11.118481 c +11.771770 9.633606 13.212650 8.940662 15.049496 8.940662 c +17.062328 8.940662 18.503208 9.974579 18.503208 11.393459 c +18.503208 12.625359 17.667278 13.395294 15.544456 13.857254 c +13.806599 14.220224 l +10.638863 14.891169 9.197983 16.365046 9.197983 18.652855 c +9.197983 21.208767 11.310505 23.015074 14.372391 23.220018 c +14.372391 24.674192 l +14.372391 25.047417 14.674950 25.349976 15.048176 25.349976 c +h +f* +n +Q + +endstream +endobj + +3 0 obj + 7959 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 90.000000 90.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000008049 00000 n +0000008072 00000 n +0000008245 00000 n +0000008319 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +8378 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90.pdf b/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90.pdf deleted file mode 100644 index 941efbfa3e..0000000000 --- a/submodules/TelegramUI/Images.xcassets/Ads/MonetizationLogo.imageset/monetization_90.pdf +++ /dev/null @@ -1,188 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 23.000000 17.500000 cm -0.000000 0.000000 0.000000 scn -37.500000 41.500000 m -37.500000 33.215729 30.784271 26.500000 22.500000 26.500000 c -14.215729 26.500000 7.500000 33.215729 7.500000 41.500000 c -7.500000 49.784271 14.215729 56.500000 22.500000 56.500000 c -30.784271 56.500000 37.500000 49.784271 37.500000 41.500000 c -h -16.055553 45.507233 m -15.908934 45.773811 16.101799 46.099998 16.406040 46.099998 c -21.299994 46.099998 l -21.299994 35.971886 l -16.055553 45.507233 l -h -23.699993 35.971840 m -28.944456 45.507229 l -29.091078 45.773815 28.898209 46.099998 28.593971 46.099998 c -23.699993 46.099998 l -23.699993 35.971840 l -h -16.406040 48.500000 m -14.276352 48.500000 12.926297 46.216698 13.952635 44.350628 c -20.046600 33.270691 l -21.110390 31.336523 23.889614 31.336515 24.953409 33.270691 c -31.047375 44.350624 l -32.073708 46.216690 30.723663 48.500000 28.593971 48.500000 c -16.406040 48.500000 l -h -4.837455 37.573509 m -5.430337 36.994904 5.441912 36.045227 4.863308 35.452347 c -3.594926 34.152664 3.000000 32.810127 3.000000 31.500000 c -3.000000 29.437628 4.521029 27.238575 7.690794 25.410986 c -7.902112 25.289146 8.120757 25.168959 8.346768 25.050571 c -11.891893 23.193604 16.893353 22.000000 22.500000 22.000000 c -28.106646 22.000000 33.108109 23.193604 36.653233 25.050571 c -40.269405 26.944759 42.000000 29.300137 42.000000 31.500000 c -42.000000 32.810127 41.405075 34.152664 40.136692 35.452347 c -39.558090 36.045227 39.569664 36.994904 40.162544 37.573509 c -40.755428 38.152111 41.705105 38.140537 42.283710 37.547653 c -43.943344 35.847065 45.000000 33.790764 45.000000 31.500000 c -45.000000 22.500000 l -45.000000 21.500000 l -45.000000 12.500000 l -45.000000 8.624733 42.029583 5.480110 38.045254 3.393078 c -33.989872 1.268829 28.491333 0.000000 22.500000 0.000000 c -16.508667 0.000000 11.010127 1.268829 6.954747 3.393078 c -2.970417 5.480110 0.000000 8.624733 0.000000 12.500000 c -0.000000 21.500000 l -0.000000 22.500000 l -0.000000 31.500000 l -0.000000 33.790764 1.056656 35.847065 2.716292 37.547653 c -3.294897 38.140537 4.244574 38.152111 4.837455 37.573509 c -h -38.045254 22.393078 m -39.540852 23.176487 40.893585 24.108913 41.999977 25.173065 c -42.000000 25.173086 l -42.000000 22.500000 l -42.000000 21.500000 l -42.000000 19.371666 40.380116 17.097767 37.000000 15.236786 c -37.000000 21.879204 l -37.358109 22.044373 37.706707 22.215744 38.045254 22.393078 c -h -34.000000 20.713173 m -32.442459 20.208160 30.765238 19.804638 29.000000 19.516380 c -29.000000 12.559616 l -30.805933 12.881241 32.486198 13.331841 34.000000 13.885990 c -34.000000 20.713173 l -h -22.500000 19.000000 m -23.688532 19.000000 24.857672 19.049931 26.000000 19.146568 c -26.000000 12.158058 l -24.866440 12.054405 23.697014 12.000000 22.500000 12.000000 c -21.651834 12.000000 20.817518 12.027317 20.000000 12.080112 c -20.000000 19.074383 l -20.821783 19.025181 21.656002 19.000000 22.500000 19.000000 c -h -22.500000 9.000000 m -23.688532 9.000000 24.857672 9.049931 26.000000 9.146568 c -26.000000 3.158058 l -24.866440 3.054405 23.697014 3.000000 22.500000 3.000000 c -21.651834 3.000000 20.817518 3.027317 20.000000 3.080112 c -20.000000 9.074383 l -20.821783 9.025181 21.656002 9.000000 22.500000 9.000000 c -h -34.000000 4.885990 m -32.486198 4.331841 30.805933 3.881241 29.000000 3.559616 c -29.000000 9.516380 l -30.765238 9.804638 32.442459 10.208160 34.000000 10.713173 c -34.000000 4.885990 l -h -17.000000 12.396725 m -17.000000 19.366760 l -14.866652 19.657177 12.848998 20.113659 11.000000 20.713173 c -11.000000 13.885990 l -12.789782 13.230812 14.812259 12.720390 17.000000 12.396725 c -h -17.000000 9.366760 m -17.000000 3.396725 l -14.812259 3.720390 12.789782 4.230812 11.000000 4.885990 c -11.000000 10.713173 l -12.848998 10.113659 14.866652 9.657177 17.000000 9.366760 c -h -6.954747 22.393078 m -7.293292 22.215744 7.641894 22.044373 8.000000 21.879204 c -8.000000 15.236786 l -4.619881 17.097767 3.000000 19.371666 3.000000 21.500000 c -3.000000 22.500000 l -3.000000 25.173086 l -3.003295 25.169918 l -4.109081 24.107075 5.460623 23.175716 6.954747 22.393078 c -h -6.954747 12.393078 m -7.293292 12.215744 7.641894 12.044373 8.000000 11.879204 c -8.000000 6.236786 l -4.619881 8.097767 3.000000 10.371666 3.000000 12.500000 c -3.000000 15.173088 l -4.106395 14.108929 5.459139 13.176491 6.954747 12.393078 c -h -37.000000 6.236786 m -40.380116 8.097767 42.000000 10.371666 42.000000 12.500000 c -42.000000 15.173088 l -40.893604 14.108929 39.540863 13.176491 38.045254 12.393078 c -37.706707 12.215744 37.358109 12.044373 37.000000 11.879204 c -37.000000 6.236786 l -h -f* -n -Q - -endstream -endobj - -3 0 obj - 4594 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 90.000000 90.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000004684 00000 n -0000004707 00000 n -0000004880 00000 n -0000004954 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -5013 -%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/Contents.json new file mode 100644 index 0000000000..4386070aa9 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "smallton.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/smallton.pdf b/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/smallton.pdf new file mode 100644 index 0000000000..6a98fc5de3 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/Ton.imageset/smallton.pdf @@ -0,0 +1,121 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.500000 0.312134 cm +0.000000 0.000000 0.000000 scn +3.779412 1.101469 m +3.404412 0.901469 l +3.779412 1.101469 l +h +4.220588 1.101469 m +3.845588 1.301469 l +4.220588 1.101469 l +h +0.252451 6.811396 m +3.404412 0.901469 l +4.154412 1.301469 l +1.002451 7.211396 l +0.252451 6.811396 l +h +4.595588 0.901469 m +7.747549 6.811396 l +6.997549 7.211396 l +3.845588 1.301469 l +4.595588 0.901469 l +h +6.666667 8.612866 m +1.333333 8.612866 l +1.333333 7.762866 l +6.666667 7.762866 l +6.666667 8.612866 l +h +7.747549 6.811396 m +8.182738 7.627376 7.591444 8.612866 6.666667 8.612866 c +6.666667 7.762866 l +6.949762 7.762866 7.130770 7.461185 6.997549 7.211396 c +7.747549 6.811396 l +h +3.404412 0.901469 m +3.658530 0.424998 4.341471 0.424999 4.595588 0.901469 c +3.845588 1.301469 l +3.911470 1.424998 4.088530 1.424999 4.154412 1.301469 c +3.404412 0.901469 l +h +1.002451 7.211396 m +0.869230 7.461185 1.050238 7.762866 1.333333 7.762866 c +1.333333 8.612866 l +0.408556 8.612866 -0.182739 7.627376 0.252451 6.811396 c +1.002451 7.211396 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 4.500000 1.500000 cm +0.000000 0.000000 0.000000 scn +-0.425000 7.000000 m +-0.425000 0.000000 l +0.425000 0.000000 l +0.425000 7.000000 l +-0.425000 7.000000 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 1280 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 9.000000 10.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000001370 00000 n +0000001393 00000 n +0000001565 00000 n +0000001639 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +1698 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/Contents.json new file mode 100644 index 0000000000..acd0a5bca6 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "tonabout.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/tonabout.pdf b/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/tonabout.pdf new file mode 100644 index 0000000000..c6ce475490 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonAbout.imageset/tonabout.pdf @@ -0,0 +1,130 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.000000 -0.384460 cm +0.000000 0.000000 0.000000 scn +1.242374 12.731012 m +0.441152 12.268769 l +0.441152 12.268769 l +1.242374 12.731012 l +h +13.757627 12.731012 m +12.956405 13.193256 l +13.757627 12.731012 l +h +7.624375 2.100044 m +6.823153 2.562287 l +7.624375 2.100044 l +h +7.375625 2.100044 m +8.176847 2.562287 l +7.375625 2.100044 l +h +8.425597 1.637801 m +14.558848 12.268769 l +12.956405 13.193256 l +6.823153 2.562287 l +8.425597 1.637801 l +h +12.513872 15.809461 m +2.486128 15.809461 l +2.486128 13.959460 l +12.513872 13.959460 l +12.513872 15.809461 l +h +0.441152 12.268769 m +6.574403 1.637801 l +8.176847 2.562287 l +2.043595 13.193256 l +0.441152 12.268769 l +h +2.486128 15.809461 m +0.669045 15.809461 -0.466886 13.842701 0.441152 12.268769 c +2.043595 13.193256 l +1.847097 13.533854 2.092911 13.959460 2.486128 13.959460 c +2.486128 15.809461 l +h +14.558848 12.268769 m +15.466886 13.842701 14.330956 15.809461 12.513872 15.809461 c +12.513872 13.959460 l +12.907089 13.959460 13.152904 13.533854 12.956405 13.193256 c +14.558848 12.268769 l +h +6.823153 2.562287 m +7.123863 3.083517 7.876137 3.083517 8.176847 2.562287 c +6.574403 1.637801 l +6.985627 0.925013 8.014373 0.925013 8.425597 1.637801 c +6.823153 2.562287 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 7.500000 2.367493 cm +0.000000 0.000000 0.000000 scn +0.925000 0.000010 m +0.925000 11.965820 l +-0.925000 11.965820 l +-0.925000 0.000010 l +0.925000 0.000010 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 1478 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 15.000000 16.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000001568 00000 n +0000001591 00000 n +0000001764 00000 n +0000001838 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +1897 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/Contents.json new file mode 100644 index 0000000000..526bf1d247 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "bigton.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/bigton.pdf b/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/bigton.pdf new file mode 100644 index 0000000000..d227cf4c57 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonBig.imageset/bigton.pdf @@ -0,0 +1,125 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 -0.038574 -0.362915 cm +0.000000 0.000000 0.000000 scn +3.266673 30.300741 m +1.409442 29.209988 l +3.266673 30.300741 l +h +18.818382 4.905025 m +20.675613 3.814270 l +18.818382 4.905025 l +h +18.181618 4.905025 m +16.324387 3.814270 l +18.181618 4.905025 l +h +20.675613 3.814270 m +35.590553 29.209982 l +31.876093 31.391491 l +16.961151 5.995781 l +20.675613 3.814270 l +h +30.549501 38.016762 m +6.450499 38.016762 l +6.450499 33.709068 l +30.549501 33.709068 l +30.549501 38.016762 l +h +1.409442 29.209988 m +16.324387 3.814270 l +20.038849 5.995779 l +5.123905 31.391497 l +1.409442 29.209988 l +h +6.450499 38.016762 m +1.930798 38.016762 -0.879433 33.107262 1.409442 29.209988 c +5.123905 31.391497 l +4.521569 32.417095 5.261104 33.709068 6.450499 33.709068 c +6.450499 38.016762 l +h +35.590553 29.209982 m +37.879429 33.107250 35.069210 38.016762 30.549501 38.016762 c +30.549501 33.709068 l +31.738892 33.709068 32.478432 32.417095 31.876093 31.391491 c +35.590553 29.209982 l +h +16.961151 5.995781 m +17.650908 7.170233 19.349079 7.170254 20.038849 5.995779 c +16.324387 3.814270 l +17.299578 2.153812 19.700438 2.153835 20.675613 3.814270 c +16.961151 5.995781 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 18.461426 4.730713 cm +0.000000 0.000000 0.000000 scn +2.153846 0.000057 m +2.153846 30.769287 l +-2.153846 30.769287 l +-2.153846 0.000057 l +2.153846 0.000057 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 1411 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 36.923096 40.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000001501 00000 n +0000001524 00000 n +0000001697 00000 n +0000001771 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +1830 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/Contents.json new file mode 100644 index 0000000000..275e65bf3e --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "mediumton.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/mediumton.pdf b/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/mediumton.pdf new file mode 100644 index 0000000000..4cbfe436c8 --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/TonMedium.imageset/mediumton.pdf @@ -0,0 +1,121 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 0.000000 -0.518555 cm +0.000000 0.000000 0.000000 scn +6.611920 1.707958 m +5.966226 2.089505 l +6.611920 1.707958 l +h +6.388080 1.707958 m +7.033774 2.089505 l +6.388080 1.707958 l +h +7.257616 1.326411 m +12.486717 10.175661 l +11.195328 10.938755 l +5.966226 2.089505 l +7.257616 1.326411 l +h +10.721817 13.268555 m +2.278183 13.268555 l +2.278183 11.768555 l +10.721817 11.768555 l +10.721817 13.268555 l +h +0.513284 10.175659 m +5.742384 1.326411 l +7.033774 2.089505 l +1.804673 10.938753 l +0.513284 10.175659 l +h +2.278183 13.268555 m +0.690869 13.268555 -0.294230 11.542221 0.513284 10.175659 c +1.804673 10.938753 l +1.588023 11.305391 1.852318 11.768555 2.278183 11.768555 c +2.278183 13.268555 l +h +12.486717 10.175661 m +13.294232 11.542225 12.309130 13.268555 10.721817 13.268555 c +10.721817 11.768555 l +11.147684 11.768555 11.411977 11.305392 11.195328 10.938755 c +12.486717 10.175661 l +h +5.966226 2.089505 m +6.206203 2.495623 6.793796 2.495623 7.033774 2.089505 c +5.742384 1.326411 l +6.082999 0.749987 6.917001 0.749988 7.257616 1.326411 c +5.966226 2.089505 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 6.500000 1.299927 cm +0.000000 0.000000 0.000000 scn +0.750000 0.000040 m +0.750000 10.833374 l +-0.750000 10.833374 l +-0.750000 0.000040 l +0.750000 0.000040 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 1324 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 13.000000 13.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000001414 00000 n +0000001437 00000 n +0000001610 00000 n +0000001684 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +1743 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/Contents.json index 3baeb9f565..8cf81d1154 100644 --- a/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "ton_30.pdf", + "filename" : "withdrawals_30.pdf", "idiom" : "universal" } ], diff --git a/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/ton_30.pdf b/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/ton_30.pdf deleted file mode 100644 index da81c52597..0000000000 --- a/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/ton_30.pdf +++ /dev/null @@ -1,117 +0,0 @@ -%PDF-1.7 - -1 0 obj - << >> -endobj - -2 0 obj - << /Length 3 0 R >> -stream -/DeviceRGB CS -/DeviceRGB cs -q -1.000000 0.000000 -0.000000 1.000000 8.343262 7.454346 cm -0.000000 0.000000 0.000000 scn -1.432826 10.484781 m -1.133278 11.041084 1.536197 11.715655 2.168021 11.715654 c -5.991703 11.715646 l -5.991703 2.038759 l -5.966153 2.072763 5.942646 2.109401 5.921499 2.148673 c -1.432826 10.484781 l -h -7.321702 2.038787 m -7.347245 2.072783 7.370744 2.109412 7.391885 2.148674 c -11.880558 10.484761 l -12.180106 11.041063 11.777191 11.715633 11.145367 11.715634 c -7.321702 11.715643 l -7.321702 2.038787 l -h -2.168024 13.045654 m -0.529820 13.045658 -0.514872 11.296619 0.261800 9.854228 c -4.750473 1.518121 l -5.567911 0.000022 7.745473 0.000024 8.562911 1.518120 c -13.051584 9.854208 l -13.828257 11.296596 12.783570 13.045631 11.145370 13.045634 c -2.168024 13.045654 l -h -f* -n -Q -q -1.000000 0.000000 -0.000000 1.000000 5.000000 3.670044 cm -0.000000 0.000000 0.000000 scn -19.334999 11.329956 m -19.334999 6.174378 15.155578 1.994957 10.000000 1.994957 c -10.000000 0.664955 l -15.890117 0.664955 20.665001 5.439839 20.665001 11.329956 c -19.334999 11.329956 l -h -10.000000 1.994957 m -4.844422 1.994957 0.665000 6.174378 0.665000 11.329956 c --0.665000 11.329956 l --0.665000 5.439839 4.109883 0.664955 10.000000 0.664955 c -10.000000 1.994957 l -h -0.665000 11.329956 m -0.665000 16.485535 4.844422 20.664955 10.000000 20.664955 c -10.000000 21.994957 l -4.109883 21.994957 -0.665000 17.220074 -0.665000 11.329956 c -0.665000 11.329956 l -h -10.000000 20.664955 m -15.155578 20.664955 19.334999 16.485535 19.334999 11.329956 c -20.665001 11.329956 l -20.665001 17.220074 15.890117 21.994957 10.000000 21.994957 c -10.000000 20.664955 l -h -f -n -Q - -endstream -endobj - -3 0 obj - 1634 -endobj - -4 0 obj - << /Annots [] - /Type /Page - /MediaBox [ 0.000000 0.000000 30.000000 30.000000 ] - /Resources 1 0 R - /Contents 2 0 R - /Parent 5 0 R - >> -endobj - -5 0 obj - << /Kids [ 4 0 R ] - /Count 1 - /Type /Pages - >> -endobj - -6 0 obj - << /Pages 5 0 R - /Type /Catalog - >> -endobj - -xref -0 7 -0000000000 65535 f -0000000010 00000 n -0000000034 00000 n -0000001724 00000 n -0000001747 00000 n -0000001920 00000 n -0000001994 00000 n -trailer -<< /ID [ (some) (id) ] - /Root 6 0 R - /Size 7 ->> -startxref -2053 -%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/withdrawals_30.pdf b/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/withdrawals_30.pdf new file mode 100644 index 0000000000..82c559d11b --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Ads/Withdrawal.imageset/withdrawals_30.pdf @@ -0,0 +1,550 @@ +%PDF-1.7 + +1 0 obj + << >> +endobj + +2 0 obj + << /Length 3 0 R >> +stream +/DeviceRGB CS +/DeviceRGB cs +q +1.000000 0.000000 -0.000000 1.000000 4.000000 15.668945 cm +0.000000 0.000000 0.000000 scn +21.782013 2.423074 m +21.189493 2.724977 l +21.782013 2.423074 l +h +20.907982 1.549042 m +21.209885 0.956522 l +20.907982 1.549042 l +h +20.907982 11.113068 m +21.209885 11.705587 l +20.907982 11.113068 l +h +21.782013 10.239036 m +21.189493 9.937132 l +21.782013 10.239036 l +h +1.092019 11.113068 m +0.790115 11.705587 l +1.092019 11.113068 l +h +0.217987 10.239036 m +-0.374532 10.540939 l +0.217987 10.239036 l +h +3.200000 10.666055 m +18.799999 10.666055 l +18.799999 11.996055 l +3.200000 11.996055 l +3.200000 10.666055 l +h +21.334999 8.131055 m +21.334999 4.531054 l +22.665001 4.531054 l +22.665001 8.131055 l +21.334999 8.131055 l +h +0.665000 4.531054 m +0.665000 8.131055 l +-0.665000 8.131055 l +-0.665000 4.531054 l +0.665000 4.531054 l +h +18.799999 1.996055 m +16.500000 1.996055 l +16.500000 0.666055 l +18.799999 0.666055 l +18.799999 1.996055 l +h +5.500000 1.996055 m +3.200000 1.996055 l +3.200000 0.666055 l +5.500000 0.666055 l +5.500000 1.996055 l +h +-0.665000 4.531054 m +-0.665000 3.981975 -0.665517 3.530171 -0.635543 3.163306 c +-0.604935 2.788678 -0.539253 2.444453 -0.374532 2.121170 c +0.810506 2.724977 l +0.757240 2.829518 0.713928 2.979231 0.690040 3.271611 c +0.665517 3.571754 0.665000 3.960029 0.665000 4.531054 c +-0.665000 4.531054 l +h +3.200000 1.996055 m +2.628974 1.996055 2.240699 1.996572 1.940556 2.021094 c +1.648176 2.044983 1.498463 2.088295 1.393923 2.141561 c +0.790115 0.956522 l +1.113398 0.791801 1.457623 0.726120 1.832252 0.695512 c +2.199117 0.665538 2.650921 0.666055 3.200000 0.666055 c +3.200000 1.996055 l +h +-0.374532 2.121170 m +-0.119030 1.619718 0.288663 1.212025 0.790115 0.956522 c +1.393923 2.141561 l +1.142726 2.269552 0.938497 2.473781 0.810506 2.724977 c +-0.374532 2.121170 l +h +21.334999 4.531054 m +21.334999 3.960029 21.334482 3.571754 21.309959 3.271611 c +21.286072 2.979231 21.242760 2.829518 21.189493 2.724977 c +22.374533 2.121170 l +22.539253 2.444453 22.604935 2.788678 22.635544 3.163306 c +22.665518 3.530171 22.665001 3.981975 22.665001 4.531054 c +21.334999 4.531054 l +h +18.799999 0.666055 m +19.349079 0.666055 19.800882 0.665538 20.167747 0.695512 c +20.542377 0.726120 20.886602 0.791801 21.209885 0.956522 c +20.606077 2.141561 l +20.501537 2.088295 20.351824 2.044983 20.059444 2.021094 c +19.759300 1.996572 19.371025 1.996055 18.799999 1.996055 c +18.799999 0.666055 l +h +21.189493 2.724977 m +21.061502 2.473781 20.857273 2.269552 20.606077 2.141561 c +21.209885 0.956522 l +21.711336 1.212025 22.119030 1.619718 22.374533 2.121170 c +21.189493 2.724977 l +h +18.799999 10.666055 m +19.371025 10.666055 19.759300 10.665538 20.059444 10.641015 c +20.351824 10.617126 20.501537 10.573814 20.606077 10.520548 c +21.209885 11.705587 l +20.886602 11.870308 20.542377 11.935989 20.167747 11.966598 c +19.800882 11.996572 19.349079 11.996055 18.799999 11.996055 c +18.799999 10.666055 l +h +22.665001 8.131055 m +22.665001 8.680134 22.665518 9.131938 22.635544 9.498803 c +22.604935 9.873431 22.539253 10.217656 22.374533 10.540939 c +21.189493 9.937132 l +21.242760 9.832591 21.286072 9.682878 21.309959 9.390499 c +21.334482 9.090355 21.334999 8.702080 21.334999 8.131055 c +22.665001 8.131055 l +h +20.606077 10.520548 m +20.857273 10.392557 21.061502 10.188329 21.189493 9.937132 c +22.374533 10.540939 l +22.119030 11.042392 21.711336 11.450085 21.209885 11.705587 c +20.606077 10.520548 l +h +3.200000 11.996055 m +2.650921 11.996055 2.199117 11.996572 1.832252 11.966598 c +1.457623 11.935989 1.113398 11.870308 0.790115 11.705587 c +1.393923 10.520548 l +1.498463 10.573814 1.648176 10.617126 1.940556 10.641015 c +2.240700 10.665538 2.628975 10.666055 3.200000 10.666055 c +3.200000 11.996055 l +h +0.665000 8.131055 m +0.665000 8.702080 0.665517 9.090355 0.690040 9.390499 c +0.713928 9.682878 0.757240 9.832591 0.810506 9.937132 c +-0.374532 10.540939 l +-0.539253 10.217656 -0.604935 9.873431 -0.635543 9.498803 c +-0.665517 9.131938 -0.665000 8.680134 -0.665000 8.131055 c +0.665000 8.131055 l +h +0.790115 11.705587 m +0.288663 11.450085 -0.119030 11.042392 -0.374532 10.540939 c +0.810506 9.937132 l +0.938497 10.188329 1.142726 10.392557 1.393923 10.520548 c +0.790115 11.705587 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 9.500000 7.669495 cm +0.000000 0.000000 0.000000 scn +0.000000 14.330505 m +0.000000 14.995505 l +-0.665000 14.995505 l +-0.665000 14.330505 l +0.000000 14.330505 l +h +11.000000 14.330505 m +11.665000 14.330505 l +11.665000 14.995505 l +11.000000 14.995505 l +11.000000 14.330505 l +h +0.217987 2.422524 m +0.810506 2.724428 l +0.217987 2.422524 l +h +10.782013 2.422524 m +10.189494 2.724428 l +10.782013 2.422524 l +h +9.907981 1.548492 m +10.209885 0.955973 l +9.907981 1.548492 l +h +0.000000 13.665505 m +11.000000 13.665505 l +11.000000 14.995505 l +0.000000 14.995505 l +0.000000 13.665505 l +h +10.335000 14.330505 m +10.335000 4.530505 l +11.665000 4.530505 l +11.665000 14.330505 l +10.335000 14.330505 l +h +7.800000 1.995505 m +3.200000 1.995505 l +3.200000 0.665505 l +7.800000 0.665505 l +7.800000 1.995505 l +h +0.665000 4.530505 m +0.665000 14.330505 l +-0.665000 14.330505 l +-0.665000 4.530505 l +0.665000 4.530505 l +h +3.200000 1.995505 m +2.628974 1.995505 2.240699 1.996022 1.940556 2.020545 c +1.648176 2.044434 1.498463 2.087746 1.393923 2.141011 c +0.790115 0.955973 l +1.113398 0.791252 1.457623 0.725571 1.832252 0.694963 c +2.199117 0.664989 2.650920 0.665505 3.200000 0.665505 c +3.200000 1.995505 l +h +-0.665000 4.530505 m +-0.665000 3.981426 -0.665517 3.529622 -0.635543 3.162757 c +-0.604935 2.788129 -0.539253 2.443904 -0.374532 2.120621 c +0.810506 2.724428 l +0.757240 2.828969 0.713928 2.978682 0.690040 3.271062 c +0.665517 3.571205 0.665000 3.959479 0.665000 4.530505 c +-0.665000 4.530505 l +h +1.393923 2.141011 m +1.142726 2.269003 0.938497 2.473231 0.810506 2.724428 c +-0.374532 2.120621 l +-0.119030 1.619168 0.288663 1.211475 0.790115 0.955973 c +1.393923 2.141011 l +h +10.335000 4.530505 m +10.335000 3.959479 10.334483 3.571204 10.309960 3.271062 c +10.286072 2.978682 10.242760 2.828969 10.189494 2.724428 c +11.374533 2.120621 l +11.539253 2.443904 11.604935 2.788129 11.635543 3.162757 c +11.665517 3.529622 11.665000 3.981426 11.665000 4.530505 c +10.335000 4.530505 l +h +7.800000 0.665505 m +8.349079 0.665505 8.800883 0.664989 9.167748 0.694963 c +9.542377 0.725571 9.886601 0.791252 10.209885 0.955973 c +9.606077 2.141011 l +9.501536 2.087746 9.351824 2.044434 9.059443 2.020545 c +8.759301 1.996022 8.371026 1.995505 7.800000 1.995505 c +7.800000 0.665505 l +h +10.189494 2.724428 m +10.061502 2.473231 9.857274 2.269003 9.606077 2.141011 c +10.209885 0.955973 l +10.711337 1.211475 11.119030 1.619168 11.374533 2.120621 c +10.189494 2.724428 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 8.000000 20.670044 cm +0.000000 0.000000 0.000000 scn +0.000000 1.994956 m +-0.367269 1.994956 -0.665000 1.697225 -0.665000 1.329956 c +-0.665000 0.962687 -0.367269 0.664956 0.000000 0.664956 c +0.000000 1.994956 l +h +14.000000 0.664956 m +14.367270 0.664956 14.665000 0.962687 14.665000 1.329956 c +14.665000 1.697225 14.367270 1.994956 14.000000 1.994956 c +14.000000 0.664956 l +h +0.000000 0.664956 m +14.000000 0.664956 l +14.000000 1.994956 l +0.000000 1.994956 l +0.000000 0.664956 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 9.500000 5.334473 cm +0.000000 0.000000 0.000000 scn +1.092019 0.883514 m +0.790115 0.290995 l +1.092019 0.883514 l +h +0.217987 1.757546 m +0.810506 2.059450 l +0.217987 1.757546 l +h +10.782013 1.757546 m +10.189494 2.059450 l +10.782013 1.757546 l +h +9.907981 0.883514 m +9.606077 1.476034 l +9.907981 0.883514 l +h +10.335000 5.665527 m +10.335000 3.865527 l +11.665000 3.865527 l +11.665000 5.665527 l +10.335000 5.665527 l +h +7.800000 1.330527 m +3.200000 1.330527 l +3.200000 0.000527 l +7.800000 0.000527 l +7.800000 1.330527 l +h +0.665000 3.865527 m +0.665000 5.665527 l +-0.665000 5.665527 l +-0.665000 3.865527 l +0.665000 3.865527 l +h +3.200000 1.330527 m +2.628974 1.330527 2.240699 1.331045 1.940556 1.355567 c +1.648176 1.379456 1.498463 1.422768 1.393923 1.476034 c +0.790115 0.290995 l +1.113398 0.126274 1.457623 0.060593 1.832252 0.029984 c +2.199117 0.000010 2.650920 0.000527 3.200000 0.000527 c +3.200000 1.330527 l +h +-0.665000 3.865527 m +-0.665000 3.316448 -0.665517 2.864644 -0.635543 2.497779 c +-0.604935 2.123151 -0.539253 1.778925 -0.374532 1.455643 c +0.810506 2.059450 l +0.757240 2.163990 0.713928 2.313704 0.690040 2.606083 c +0.665517 2.906227 0.665000 3.294502 0.665000 3.865527 c +-0.665000 3.865527 l +h +1.393923 1.476034 m +1.142726 1.604024 0.938497 1.808254 0.810506 2.059450 c +-0.374532 1.455643 l +-0.119030 0.954191 0.288663 0.546497 0.790115 0.290995 c +1.393923 1.476034 l +h +10.335000 3.865527 m +10.335000 3.294502 10.334483 2.906227 10.309960 2.606083 c +10.286072 2.313704 10.242760 2.163990 10.189494 2.059450 c +11.374533 1.455643 l +11.539253 1.778925 11.604935 2.123151 11.635543 2.497779 c +11.665517 2.864644 11.665000 3.316448 11.665000 3.865527 c +10.335000 3.865527 l +h +7.800000 0.000527 m +8.349079 0.000527 8.800883 0.000010 9.167748 0.029984 c +9.542377 0.060593 9.886601 0.126274 10.209885 0.290995 c +9.606077 1.476034 l +9.501536 1.422768 9.351824 1.379456 9.059443 1.355567 c +8.759301 1.331045 8.371026 1.330527 7.800000 1.330527 c +7.800000 0.000527 l +h +10.189494 2.059450 m +10.061502 1.808254 9.857274 1.604024 9.606077 1.476034 c +10.209885 0.290995 l +10.711337 0.546497 11.119030 0.954191 11.374533 1.455643 c +10.189494 2.059450 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 9.500000 2.334473 cm +0.000000 0.000000 0.000000 scn +1.092019 0.883514 m +0.790115 0.290995 l +1.092019 0.883514 l +h +0.217987 1.757546 m +0.810506 2.059450 l +0.217987 1.757546 l +h +10.782013 1.757546 m +10.189494 2.059450 l +10.782013 1.757546 l +h +9.907981 0.883514 m +9.606077 1.476034 l +9.907981 0.883514 l +h +10.335000 5.665527 m +10.335000 3.865527 l +11.665000 3.865527 l +11.665000 5.665527 l +10.335000 5.665527 l +h +7.800000 1.330527 m +3.200000 1.330527 l +3.200000 0.000527 l +7.800000 0.000527 l +7.800000 1.330527 l +h +0.665000 3.865527 m +0.665000 5.665527 l +-0.665000 5.665527 l +-0.665000 3.865527 l +0.665000 3.865527 l +h +3.200000 1.330527 m +2.628974 1.330527 2.240699 1.331045 1.940556 1.355567 c +1.648176 1.379456 1.498463 1.422768 1.393923 1.476034 c +0.790115 0.290995 l +1.113398 0.126274 1.457623 0.060593 1.832252 0.029984 c +2.199117 0.000010 2.650920 0.000527 3.200000 0.000527 c +3.200000 1.330527 l +h +-0.665000 3.865527 m +-0.665000 3.316448 -0.665517 2.864644 -0.635543 2.497779 c +-0.604935 2.123151 -0.539253 1.778925 -0.374532 1.455643 c +0.810506 2.059450 l +0.757240 2.163990 0.713928 2.313704 0.690040 2.606083 c +0.665517 2.906227 0.665000 3.294502 0.665000 3.865527 c +-0.665000 3.865527 l +h +1.393923 1.476034 m +1.142726 1.604024 0.938497 1.808254 0.810506 2.059450 c +-0.374532 1.455643 l +-0.119030 0.954191 0.288663 0.546497 0.790115 0.290995 c +1.393923 1.476034 l +h +10.335000 3.865527 m +10.335000 3.294502 10.334483 2.906227 10.309960 2.606083 c +10.286072 2.313704 10.242760 2.163990 10.189494 2.059450 c +11.374533 1.455643 l +11.539253 1.778925 11.604935 2.123151 11.635543 2.497779 c +11.665517 2.864644 11.665000 3.316448 11.665000 3.865527 c +10.335000 3.865527 l +h +7.800000 0.000527 m +8.349079 0.000527 8.800883 0.000010 9.167748 0.029984 c +9.542377 0.060593 9.886601 0.126274 10.209885 0.290995 c +9.606077 1.476034 l +9.501536 1.422768 9.351824 1.379456 9.059443 1.355567 c +8.759301 1.331045 8.371026 1.330527 7.800000 1.330527 c +7.800000 0.000527 l +h +10.189494 2.059450 m +10.061502 1.808254 9.857274 1.604024 9.606077 1.476034 c +10.209885 0.290995 l +10.711337 0.546497 11.119030 0.954191 11.374533 1.455643 c +10.189494 2.059450 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 15.000000 11.170044 cm +0.000000 0.000000 0.000000 scn +0.665000 7.829956 m +0.665000 8.197226 0.367269 8.494956 0.000000 8.494956 c +-0.367269 8.494956 -0.665000 8.197226 -0.665000 7.829956 c +0.665000 7.829956 l +h +-0.665000 1.329956 m +-0.665000 0.962687 -0.367269 0.664956 0.000000 0.664956 c +0.367269 0.664956 0.665000 0.962687 0.665000 1.329956 c +-0.665000 1.329956 l +h +-0.665000 7.829956 m +-0.665000 1.329956 l +0.665000 1.329956 l +0.665000 7.829956 l +-0.665000 7.829956 l +h +f +n +Q +q +1.000000 0.000000 -0.000000 1.000000 12.000000 10.540161 cm +0.000000 0.000000 0.000000 scn +0.470226 4.930065 m +0.210527 5.189764 -0.210527 5.189764 -0.470226 4.930065 c +-0.729925 4.670366 -0.729925 4.249311 -0.470226 3.989613 c +0.470226 4.930065 l +h +3.000000 1.459839 m +2.529774 0.989613 l +2.789473 0.729914 3.210527 0.729914 3.470226 0.989613 c +3.000000 1.459839 l +h +6.470226 3.989613 m +6.729925 4.249311 6.729925 4.670366 6.470226 4.930065 c +6.210527 5.189764 5.789473 5.189764 5.529774 4.930065 c +6.470226 3.989613 l +h +-0.470226 3.989613 m +2.529774 0.989613 l +3.470226 1.930065 l +0.470226 4.930065 l +-0.470226 3.989613 l +h +3.470226 0.989613 m +6.470226 3.989613 l +5.529774 4.930065 l +2.529774 1.930065 l +3.470226 0.989613 l +h +f +n +Q + +endstream +endobj + +3 0 obj + 12793 +endobj + +4 0 obj + << /Annots [] + /Type /Page + /MediaBox [ 0.000000 0.000000 30.000000 30.000000 ] + /Resources 1 0 R + /Contents 2 0 R + /Parent 5 0 R + >> +endobj + +5 0 obj + << /Kids [ 4 0 R ] + /Count 1 + /Type /Pages + >> +endobj + +6 0 obj + << /Pages 5 0 R + /Type /Catalog + >> +endobj + +xref +0 7 +0000000000 65535 f +0000000010 00000 n +0000000034 00000 n +0000012883 00000 n +0000012907 00000 n +0000013080 00000 n +0000013154 00000 n +trailer +<< /ID [ (some) (id) ] + /Root 6 0 R + /Size 7 +>> +startxref +13213 +%%EOF \ No newline at end of file diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index 3c59fe4e40..d6e369d8b2 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -476,6 +476,50 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState var actions: [ContextMenuItem] = [] + if adAttribute.sponsorInfo != nil || adAttribute.additionalInfo != nil { + actions.append(.action(ContextMenuActionItem(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfo, textColor: .primary, icon: { theme in + return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Channels"), color: theme.actionSheet.primaryTextColor) + }, iconSource: nil, action: { c, _ in + var subItems: [ContextMenuItem] = [] + + subItems.append(.action(ContextMenuActionItem(text: presentationData.strings.Common_Back, textColor: .primary, icon: { theme in + return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Back"), color: theme.actionSheet.primaryTextColor) + }, iconSource: nil, iconPosition: .left, action: { c, _ in + c.popItems() + }))) + + subItems.append(.separator) + + if let sponsorInfo = adAttribute.sponsorInfo { + subItems.append(.action(ContextMenuActionItem(text: sponsorInfo, textColor: .primary, textLayout: .multiline, textFont: .custom(font: Font.regular(floor(presentationData.listsFontSize.baseDisplaySize * 0.8)), height: nil, verticalOffset: nil), badge: nil, icon: { theme in + return nil + }, iconSource: nil, action: { [weak controllerInteraction] c, _ in + c.dismiss(completion: { + UIPasteboard.general.string = sponsorInfo + + let content: UndoOverlayContent = .copy(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfoCopied) + controllerInteraction?.displayUndo(content) + }) + }))) + } + if let additionalInfo = adAttribute.additionalInfo { + subItems.append(.action(ContextMenuActionItem(text: additionalInfo, textColor: .primary, textLayout: .multiline, textFont: .custom(font: Font.regular(floor(presentationData.listsFontSize.baseDisplaySize * 0.8)), height: nil, verticalOffset: nil), badge: nil, icon: { theme in + return nil + }, iconSource: nil, action: { [weak controllerInteraction] c, _ in + c.dismiss(completion: { + UIPasteboard.general.string = additionalInfo + + let content: UndoOverlayContent = .copy(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfoCopied) + controllerInteraction?.displayUndo(content) + }) + }))) + } + + c.pushItems(items: .single(ContextController.Items(content: .list(subItems)))) + }))) + actions.append(.separator) + } + if adAttribute.canReport { actions.append(.action(ContextMenuActionItem(text: presentationData.strings.Chat_ContextMenu_AboutAd, textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(font: Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0), height: nil, verticalOffset: nil), badge: nil, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor) @@ -532,50 +576,6 @@ func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState }) }))) } else { - if adAttribute.sponsorInfo != nil || adAttribute.additionalInfo != nil { - actions.append(.action(ContextMenuActionItem(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfo, textColor: .primary, icon: { theme in - return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Channels"), color: theme.actionSheet.primaryTextColor) - }, iconSource: nil, action: { c, _ in - var subItems: [ContextMenuItem] = [] - - subItems.append(.action(ContextMenuActionItem(text: presentationData.strings.Common_Back, textColor: .primary, icon: { theme in - return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Back"), color: theme.actionSheet.primaryTextColor) - }, iconSource: nil, iconPosition: .left, action: { c, _ in - c.popItems() - }))) - - subItems.append(.separator) - - if let sponsorInfo = adAttribute.sponsorInfo { - subItems.append(.action(ContextMenuActionItem(text: sponsorInfo, textColor: .primary, textLayout: .multiline, textFont: .custom(font: Font.regular(floor(presentationData.listsFontSize.baseDisplaySize * 0.8)), height: nil, verticalOffset: nil), badge: nil, icon: { theme in - return nil - }, iconSource: nil, action: { [weak controllerInteraction] c, _ in - c.dismiss(completion: { - UIPasteboard.general.string = sponsorInfo - - let content: UndoOverlayContent = .copy(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfoCopied) - controllerInteraction?.displayUndo(content) - }) - }))) - } - if let additionalInfo = adAttribute.additionalInfo { - subItems.append(.action(ContextMenuActionItem(text: additionalInfo, textColor: .primary, textLayout: .multiline, textFont: .custom(font: Font.regular(floor(presentationData.listsFontSize.baseDisplaySize * 0.8)), height: nil, verticalOffset: nil), badge: nil, icon: { theme in - return nil - }, iconSource: nil, action: { [weak controllerInteraction] c, _ in - c.dismiss(completion: { - UIPasteboard.general.string = additionalInfo - - let content: UndoOverlayContent = .copy(text: presentationData.strings.Chat_ContextMenu_AdSponsorInfoCopied) - controllerInteraction?.displayUndo(content) - }) - }))) - } - - c.pushItems(items: .single(ContextController.Items(content: .list(subItems)))) - }))) - actions.append(.separator) - } - actions.append(.action(ContextMenuActionItem(text: presentationData.strings.SponsoredMessageMenu_Info, textColor: .primary, textLayout: .twoLinesMax, textFont: .custom(font: Font.regular(presentationData.listsFontSize.baseDisplaySize - 1.0), height: nil, verticalOffset: nil), badge: nil, icon: { theme in return generateTintedImage(image: UIImage(bundleImageName: "Chat/Context Menu/Info"), color: theme.actionSheet.primaryTextColor) }, iconSource: nil, action: { _, f in From 78a0365a1e7b11895e2ce4a1a297075e7948da50 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 3 Apr 2024 13:25:15 +0400 Subject: [PATCH 2/5] Cherry-pick various fixes --- submodules/PremiumUI/Sources/CreateGiveawayController.swift | 6 ++++-- .../Sources/TelegramEngine/Messages/AdMessages.swift | 2 +- .../Sources/ChatMessageWebpageBubbleContentNode.swift | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/submodules/PremiumUI/Sources/CreateGiveawayController.swift b/submodules/PremiumUI/Sources/CreateGiveawayController.swift index 846d11ad8f..9976989cf2 100644 --- a/submodules/PremiumUI/Sources/CreateGiveawayController.swift +++ b/submodules/PremiumUI/Sources/CreateGiveawayController.swift @@ -854,7 +854,7 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio let expiryDate = calendar.date(byAdding: .day, value: 3, to: calendar.date(from: components)!)! let expiryTime = Int32(expiryDate.timeIntervalSince1970) - let minDate = currentTime + 60 * 30 + let minDate = currentTime + 60 * 1 let maxDate = currentTime + context.userLimits.maxGiveawayPeriodSeconds let initialState: CreateGiveawayControllerState = CreateGiveawayControllerState(mode: .giveaway, subscriptions: initialSubscriptions, time: expiryTime) @@ -1099,7 +1099,9 @@ public func createGiveawayController(context: AccountContext, updatedPresentatio let quantity: Int32 switch state.mode { case .giveaway: - purpose = .giveaway(boostPeer: peerId, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: state.time, currency: currency, amount: amount) + let currentTime = Int32(CFAbsoluteTimeGetCurrent() + kCFAbsoluteTimeIntervalSince1970) + let untilDate = max(state.time, currentTime + 60) + purpose = .giveaway(boostPeer: peerId, additionalPeerIds: state.channels.filter { $0 != peerId }, countries: state.countries, onlyNewSubscribers: state.onlyNewEligible, showWinners: state.showWinners, prizeDescription: state.prizeDescription.isEmpty ? nil : state.prizeDescription, randomId: Int64.random(in: .min ..< .max), untilDate: untilDate, currency: currency, amount: amount) quantity = selectedProduct.giftOption.storeQuantity case .gift: purpose = .giftCode(peerIds: state.peers, boostPeer: peerId, currency: currency, amount: amount) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift index 83ad6be77b..1ac7a60ab0 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/AdMessages.swift @@ -230,7 +230,7 @@ private class AdMessagesHistoryContextImpl { self.sponsorInfo = try container.decodeIfPresent(String.self, forKey: .sponsorInfo) self.additionalInfo = try container.decodeIfPresent(String.self, forKey: .additionalInfo) - self.canReport = try container.decodeIfPresent(Bool.self, forKey: .displayAvatar) ?? false + self.canReport = try container.decodeIfPresent(Bool.self, forKey: .canReport) ?? false } public func encode(to encoder: Encoder) throws { diff --git a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift index 39318cae99..4315bccdf9 100644 --- a/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift +++ b/submodules/TelegramUI/Components/Chat/ChatMessageWebpageBubbleContentNode/Sources/ChatMessageWebpageBubbleContentNode.swift @@ -510,9 +510,6 @@ public final class ChatMessageWebpageBubbleContentNode: ChatMessageBubbleContent break } } - if adAttribute.displayAvatar && adAttribute.canReport, let profileImage = item.message.author?.smallProfileImage { - mediaAndFlags = (TelegramMediaImage(imageId: MediaId(namespace: 0, id: 0), representations: [profileImage], immediateThumbnailData: nil, reference: nil, partialReference: nil, flags: []), [.preferMediaInline]) - } if adAttribute.canReport { titleBadge = item.presentationData.strings.Message_AdWhatIsThis From 1256eb57945f88fa81406e3815341cdb11f16369 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 3 Apr 2024 13:25:37 +0400 Subject: [PATCH 3/5] Bump version --- versions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.json b/versions.json index a1bd5122fb..0d8fbcafc9 100644 --- a/versions.json +++ b/versions.json @@ -1,6 +1,6 @@ { "app": "10.9.2", - "app": "10.10", + "app": "10.10.1", "bazel": "7.0.2", "xcode": "15.2", "macos": "13.0" From b6f8f8333d9aeb13c3032af71a84e92fbd33624b Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Wed, 3 Apr 2024 15:43:12 +0400 Subject: [PATCH 4/5] Bug fixes --- .../Telegram-iOS/en.lproj/Localizable.strings | 3 +++ .../Sources/ContactContextMenus.swift | 10 +++++--- .../Sources/ChannelAdminController.swift | 15 +++++++++-- .../Sources/ChannelMembersController.swift | 2 +- .../TelegramEngine/Peers/AddPeerMember.swift | 12 ++++----- .../Peers/CreateSecretChat.swift | 3 +++ .../PeerInfoScreenBusinessHoursItem.swift | 19 +++++++++++++- .../Sources/PeerInfoMembers.swift | 3 ++- .../Sources/PeerInfoScreen.swift | 10 +++++--- .../Sources/SendInviteLinkScreen.swift | 25 +++++++++++++++---- .../TelegramUI/Sources/ChatController.swift | 9 +++++-- .../ChatInterfaceStateContextMenus.swift | 13 ++++++++-- 12 files changed, 96 insertions(+), 28 deletions(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 294cc63b0f..e7aed4d954 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -11800,9 +11800,12 @@ Sorry for the inconvenience."; "SendInviteLink.TitleUpgradeToPremium" = "Upgrade to Premium"; "SendInviteLink.TextContactsAndPremiumOneUser" = "**%@** accepts invitations to groups from contacts and **Premium** users."; +"SendInviteLink.ChannelTextContactsAndPremiumOneUser" = "**%@** accepts invitations to channels from contacts and **Premium** users."; "SendInviteLink.TextContactsAndPremiumMultipleUsers_1" = "{user_list}, and **%d** more person only accept invitations to groups from contacts and **Premium** users."; "SendInviteLink.TextContactsAndPremiumMultipleUsers_any" = "{user_list}, and **%d** more people only accept invitations to groups from contacts and **Premium** users."; +"SendInviteLink.ChannelTextContactsAndPremiumMultipleUsers_1" = "{user_list}, and **%d** more person only accept invitations to channels from contacts and **Premium** users."; +"SendInviteLink.ChannelTextContactsAndPremiumMultipleUsers_any" = "{user_list}, and **%d** more people only accept invitations to channels from contacts and **Premium** users."; "SendInviteLink.SubscribeToPremiumButton" = "Subscribe to Telegram Premium"; "SendInviteLink.PremiumOrSendSectionSeparator" = "or"; diff --git a/submodules/ContactListUI/Sources/ContactContextMenus.swift b/submodules/ContactListUI/Sources/ContactContextMenus.swift index 216be65305..8e8815dc86 100644 --- a/submodules/ContactListUI/Sources/ContactContextMenus.swift +++ b/submodules/ContactListUI/Sources/ContactContextMenus.swift @@ -188,10 +188,12 @@ func contactContextMenuItems(context: AccountContext, peerId: EnginePeer.Id, con let presentationData = context.sharedContext.currentPresentationData.with { $0 } let text: String switch error { - case .limitExceeded: - text = presentationData.strings.TwoStepAuth_FloodError - default: - text = presentationData.strings.Login_UnknownError + case .limitExceeded: + text = presentationData.strings.TwoStepAuth_FloodError + case .premiumRequired: + text = presentationData.strings.Conversation_SendMessageErrorNonPremiumForbidden(peer.compactDisplayTitle).string + default: + text = presentationData.strings.Login_UnknownError } contactsController.present(textAlertController(context: context, title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), in: .window(.root)) } diff --git a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift index 588c242c38..42a9faa2f3 100644 --- a/submodules/PeerInfoUI/Sources/ChannelAdminController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelAdminController.swift @@ -1510,8 +1510,19 @@ public func channelAdminController(context: AccountContext, updatedPresentationD } updateRightsDisposable.set((context.engine.peers.addGroupAdmin(peerId: peerId, adminId: adminId) |> deliverOnMainQueue).start(error: { error in - if case let .addMemberError(error) = error, case .privacy = error, let admin = adminPeer { - presentControllerImpl?(textAlertController(context: context, updatedPresentationData: updatedPresentationData, title: nil, text: presentationData.strings.Privacy_GroupsAndChannels_InviteToGroupError(admin.compactDisplayTitle, admin.compactDisplayTitle).string, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) + if case let .addMemberError(error) = error, case let .privacy(privacy) = error, let admin = adminPeer { + if let failedPeer = privacy?.forbiddenPeers.first { + let _ = (context.engine.data.get( + TelegramEngine.EngineData.Item.Peer.ExportedInvitation(id: group.id) + ) + |> deliverOnMainQueue).startStandalone(next: { exportedInvitation in + let _ = exportedInvitation + let inviteScreen = SendInviteLinkScreen(context: context, peer: .legacyGroup(group), link: exportedInvitation?.link, peers: [failedPeer]) + pushControllerImpl?(inviteScreen) + }) + } else { + presentControllerImpl?(textAlertController(context: context, updatedPresentationData: updatedPresentationData, title: nil, text: presentationData.strings.Privacy_GroupsAndChannels_InviteToGroupError(admin.compactDisplayTitle, admin.compactDisplayTitle).string, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) + } } else if case .adminsTooMuch = error { presentControllerImpl?(textAlertController(context: context, updatedPresentationData: updatedPresentationData, title: nil, text: presentationData.strings.Group_ErrorAdminsTooMuch, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil) } diff --git a/submodules/PeerInfoUI/Sources/ChannelMembersController.swift b/submodules/PeerInfoUI/Sources/ChannelMembersController.swift index 49341c10bf..cbc787a359 100644 --- a/submodules/PeerInfoUI/Sources/ChannelMembersController.swift +++ b/submodules/PeerInfoUI/Sources/ChannelMembersController.swift @@ -518,7 +518,7 @@ public func channelMembersController(context: AccountContext, updatedPresentatio ) |> deliverOnMainQueue).start(next: { chatPeer, exportedInvitation, members in let disabledIds = members?.compactMap({$0.peer.id}) ?? [] - let contactsController = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(context: context, updatedPresentationData: updatedPresentationData, mode: .peerSelection(searchChatList: false, searchGroups: false, searchChannels: false), options: [], filters: [.excludeSelf, .disable(disabledIds)], onlyWriteable: true)) + let contactsController = context.sharedContext.makeContactMultiselectionController(ContactMultiselectionControllerParams(context: context, updatedPresentationData: updatedPresentationData, mode: .peerSelection(searchChatList: false, searchGroups: false, searchChannels: false), options: [], filters: [.excludeSelf, .disable(disabledIds)], onlyWriteable: true, isGroupInvitation: true)) addMembersDisposable.set(( contactsController.result diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift index eddd975006..dfbda21313 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/AddPeerMember.swift @@ -53,18 +53,18 @@ func _internal_addGroupMember(account: Account, peerId: PeerId, memberId: PeerId if let peer = transaction.getPeer(peerId), let memberPeer = transaction.getPeer(memberId), let inputUser = apiInputUser(memberPeer) { if let group = peer as? TelegramGroup { return account.network.request(Api.functions.messages.addChatUser(chatId: group.id.id._internalGetInt64Value(), userId: inputUser, fwdLimit: 100)) - |> mapError { error -> AddGroupMemberError in + |> `catch` { error -> Signal in switch error.errorDescription { case "USERS_TOO_MUCH": - return .groupFull + return .fail(.groupFull) case "USER_PRIVACY_RESTRICTED": - return .privacy(nil) + return .fail(.privacy(nil)) case "USER_CHANNELS_TOO_MUCH": - return .tooManyChannels + return .fail(.tooManyChannels) case "USER_NOT_MUTUAL_CONTACT": - return .notMutualContact + return .fail(.privacy(nil)) default: - return .generic + return .fail(.generic) } } |> mapToSignal { result -> Signal in diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/CreateSecretChat.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/CreateSecretChat.swift index 5a909d36b8..0857c57803 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/CreateSecretChat.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/CreateSecretChat.swift @@ -7,6 +7,7 @@ import MtProtoKit public enum CreateSecretChatError { case generic case limitExceeded + case premiumRequired } func _internal_createSecretChat(account: Account, peerId: PeerId) -> Signal { @@ -34,6 +35,8 @@ func _internal_createSecretChat(account: Account, peerId: PeerId) -> Signal mapError { error -> CreateSecretChatError in if error.errorDescription.hasPrefix("FLOOD_WAIT_") { return .limitExceeded + } else if error.errorDescription == "PRIVACY_PREMIUM_REQUIRED" { + return .premiumRequired } else { return .generic } diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenBusinessHoursItem.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenBusinessHoursItem.swift index 87b007469a..c12ce928a7 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenBusinessHoursItem.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/ListItems/PeerInfoScreenBusinessHoursItem.swift @@ -399,8 +399,25 @@ private final class PeerInfoScreenBusinessHoursItemNode: PeerInfoScreenItemNode containerSize: CGSize(width: width - sideInset - dayRightInset, height: 100.0) ) - var timezoneSwitchButtonSize: CGSize? + var hasTimezoneDependentEntries = false if item.businessHours.timezoneId != self.currentTimezone.identifier { + var currentCalendar = Calendar(identifier: .gregorian) + currentCalendar.timeZone = TimeZone(identifier: item.businessHours.timezoneId) ?? TimeZone.current + + let timezoneOffsetMinutes = (self.currentTimezone.secondsFromGMT() - currentCalendar.timeZone.secondsFromGMT()) / 60 + + for i in 0 ..< businessDays.count { + let businessHoursTextLocal = dayBusinessHoursText(presentationData: presentationData, day: businessDays[i], offsetMinutes: 0) + let businessHoursTextOffset = dayBusinessHoursText(presentationData: presentationData, day: businessDays[i], offsetMinutes: timezoneOffsetMinutes) + if businessHoursTextOffset != businessHoursTextLocal { + hasTimezoneDependentEntries = true + break + } + } + } + + var timezoneSwitchButtonSize: CGSize? + if hasTimezoneDependentEntries { let timezoneSwitchButton: ComponentView if let current = self.timezoneSwitchButton { timezoneSwitchButton = current diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoMembers.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoMembers.swift index 7b8ac46a98..801d58db58 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoMembers.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoMembers.swift @@ -309,7 +309,8 @@ private final class PeerInfoMembersContextImpl { guard let strongSelf = self else { return } - if let _ = strongSelf.removingMemberIds.removeValue(forKey: memberId) { + if let disposable = strongSelf.removingMemberIds.removeValue(forKey: memberId) { + disposable.dispose() strongSelf.pushState() } } diff --git a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift index 4256d39642..a44b11e00e 100644 --- a/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Components/PeerInfo/PeerInfoScreen/Sources/PeerInfoScreen.swift @@ -6514,10 +6514,12 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro } let text: String switch error { - case .limitExceeded: - text = strongSelf.presentationData.strings.TwoStepAuth_FloodError - default: - text = strongSelf.presentationData.strings.Login_UnknownError + case .limitExceeded: + text = strongSelf.presentationData.strings.TwoStepAuth_FloodError + case .premiumRequired: + text = strongSelf.presentationData.strings.Conversation_SendMessageErrorNonPremiumForbidden(displayTitle).string + default: + text = strongSelf.presentationData.strings.Login_UnknownError } strongSelf.controller?.present(textAlertController(context: strongSelf.context, updatedPresentationData: strongSelf.controller?.updatedPresentationData, title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: strongSelf.presentationData.strings.Common_OK, action: {})]), in: .window(.root)) })) diff --git a/submodules/TelegramUI/Components/SendInviteLinkScreen/Sources/SendInviteLinkScreen.swift b/submodules/TelegramUI/Components/SendInviteLinkScreen/Sources/SendInviteLinkScreen.swift index b4c33abae9..b75ef97dde 100644 --- a/submodules/TelegramUI/Components/SendInviteLinkScreen/Sources/SendInviteLinkScreen.swift +++ b/submodules/TelegramUI/Components/SendInviteLinkScreen/Sources/SendInviteLinkScreen.swift @@ -22,17 +22,20 @@ private final class SendInviteLinkScreenComponent: Component { typealias EnvironmentType = ViewControllerComponentContainer.Environment let context: AccountContext + let peer: EnginePeer let link: String? let peers: [TelegramForbiddenInvitePeer] let peerPresences: [EnginePeer.Id: EnginePeer.Presence] init( context: AccountContext, + peer: EnginePeer, link: String?, peers: [TelegramForbiddenInvitePeer], peerPresences: [EnginePeer.Id: EnginePeer.Presence] ) { self.context = context + self.peer = peer self.link = link self.peers = peers self.peerPresences = peerPresences @@ -412,7 +415,11 @@ private final class SendInviteLinkScreenComponent: Component { let text: String if premiumRestrictedUsers.count == 1 { - text = environment.strings.SendInviteLink_TextContactsAndPremiumOneUser(premiumRestrictedUsers[0].peer.compactDisplayTitle).string + if case let .channel(channel) = component.peer, case .broadcast = channel.info { + text = environment.strings.SendInviteLink_ChannelTextContactsAndPremiumOneUser(premiumRestrictedUsers[0].peer.compactDisplayTitle).string + } else { + text = environment.strings.SendInviteLink_TextContactsAndPremiumOneUser(premiumRestrictedUsers[0].peer.compactDisplayTitle).string + } } else { let extraCount = premiumRestrictedUsers.count - 3 @@ -439,9 +446,17 @@ private final class SendInviteLinkScreenComponent: Component { } if extraCount >= 1 { - text = environment.strings.SendInviteLink_TextContactsAndPremiumMultipleUsers(Int32(extraCount)).replacingOccurrences(of: "{user_list}", with: peersText) + if case let .channel(channel) = component.peer, case .broadcast = channel.info { + text = environment.strings.SendInviteLink_ChannelTextContactsAndPremiumMultipleUsers(Int32(extraCount)).replacingOccurrences(of: "{user_list}", with: peersText) + } else { + text = environment.strings.SendInviteLink_TextContactsAndPremiumMultipleUsers(Int32(extraCount)).replacingOccurrences(of: "{user_list}", with: peersText) + } } else { - text = environment.strings.SendInviteLink_TextContactsAndPremiumOneUser(peersText).string + if case let .channel(channel) = component.peer, case .broadcast = channel.info { + text = environment.strings.SendInviteLink_ChannelTextContactsAndPremiumOneUser(peersText).string + } else { + text = environment.strings.SendInviteLink_TextContactsAndPremiumOneUser(peersText).string + } } } @@ -1066,7 +1081,7 @@ public class SendInviteLinkScreen: ViewControllerComponentContainer { self.link = link self.peers = peers - super.init(context: context, component: SendInviteLinkScreenComponent(context: context, link: link, peers: peers, peerPresences: [:]), navigationBarAppearance: .none) + super.init(context: context, component: SendInviteLinkScreenComponent(context: context, peer: peer, link: link, peers: peers, peerPresences: [:]), navigationBarAppearance: .none) self.statusBar.statusBarStyle = .Ignore self.navigationPresentation = .flatModal @@ -1085,7 +1100,7 @@ public class SendInviteLinkScreen: ViewControllerComponentContainer { parsedPresences[id] = presence } } - self.updateComponent(component: AnyComponent(SendInviteLinkScreenComponent(context: context, link: link, peers: peers, peerPresences: parsedPresences)), transition: .immediate) + self.updateComponent(component: AnyComponent(SendInviteLinkScreenComponent(context: context, peer: peer, link: link, peers: peers, peerPresences: parsedPresences)), transition: .immediate) }) } diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 0c5f28a39a..9ea3450b07 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -7637,7 +7637,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } }) if let editMessage = interfaceState.editMessage, let message = combinedInitialData.initialData?.associatedMessages[editMessage.messageId] { - updated = updatedChatEditInterfaceMessageState(state: updated, message: message) + let (updatedState, updatedPreviewQueryState) = updatedChatEditInterfaceMessageState(context: strongSelf.context, state: updated, message: message) + updated = updatedState + strongSelf.editingUrlPreviewQueryState = updatedPreviewQueryState } updated = updated.updatedSlowmodeState(slowmodeState) return updated @@ -8972,7 +8974,10 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G return interfaceState.withUpdatedEditMessage(ChatEditMessageState(messageId: messageId, inputState: ChatTextInputState(inputText: inputText), disableUrlPreviews: disableUrlPreviews, inputTextMaxLength: inputTextMaxLength)) } - updated = updatedChatEditInterfaceMessageState(state: updated, message: message) + let (updatedState, updatedPreviewQueryState) = updatedChatEditInterfaceMessageState(context: strongSelf.context, state: updated, message: message) + updated = updatedState + strongSelf.editingUrlPreviewQueryState = updatedPreviewQueryState + updated = updated.updatedInputMode({ _ in return .text }) diff --git a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift index d6e369d8b2..769b7768d1 100644 --- a/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/Sources/ChatInterfaceStateContextMenus.swift @@ -419,7 +419,7 @@ func messageMediaEditingOptions(message: Message) -> MessageMediaEditingOptions return options } -func updatedChatEditInterfaceMessageState(state: ChatPresentationInterfaceState, message: Message) -> ChatPresentationInterfaceState { +func updatedChatEditInterfaceMessageState(context: AccountContext, state: ChatPresentationInterfaceState, message: Message) -> (ChatPresentationInterfaceState, (UrlPreviewState?, Disposable)?) { var updated = state for media in message.media { if let webpage = media as? TelegramMediaWebpage, case let .Loaded(content) = webpage.content { @@ -451,7 +451,16 @@ func updatedChatEditInterfaceMessageState(state: ChatPresentationInterfaceState, content = .media(mediaOptions: messageMediaEditingOptions(message: message)) } updated = updated.updatedEditMessageState(ChatEditInterfaceMessageState(content: content, mediaReference: nil)) - return updated + + var previewState: (UrlPreviewState?, Disposable)? + if let (updatedEditingUrlPreviewState, _) = urlPreviewStateForInputText(updated.interfaceState.editMessage?.inputState.inputText, context: context, currentQuery: nil, forPeerId: state.chatLocation.peerId) { + previewState = (updatedEditingUrlPreviewState, EmptyDisposable) + } + + return ( + updated, + previewState + ) } func contextMenuForChatPresentationInterfaceState(chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, messages: [Message], controllerInteraction: ChatControllerInteraction?, selectAll: Bool, interfaceInteraction: ChatPanelInterfaceInteraction?, readStats: MessageReadStats? = nil, messageNode: ChatMessageItemView? = nil) -> Signal { From abb3b1b2d9d1402a4474a9f2b0ec8f50cf7ffd70 Mon Sep 17 00:00:00 2001 From: Isaac <> Date: Wed, 3 Apr 2024 15:45:11 +0400 Subject: [PATCH 5/5] Bug fixes --- .../Sources/TelegramEngine/Messages/QuickReplyMessages.swift | 2 ++ .../Sources/TelegramEngine/Peers/UpdateCachedPeerData.swift | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/QuickReplyMessages.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/QuickReplyMessages.swift index 0144b0d438..2f5b83d23f 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/QuickReplyMessages.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/QuickReplyMessages.swift @@ -1068,6 +1068,8 @@ public func _internal_setAccountConnectedBot(account: Account, bot: TelegramAcco flags |= 1 << 0 } mappedRecipients = bot.recipients.apiInputBotValue(additionalPeers: additionalPeers, excludePeers: excludePeers) + } else { + flags |= 1 << 1 } return account.network.request(Api.functions.account.updateConnectedBot(flags: flags, bot: mappedBot, recipients: mappedRecipients)) diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Peers/UpdateCachedPeerData.swift b/submodules/TelegramCore/Sources/TelegramEngine/Peers/UpdateCachedPeerData.swift index a815a0071a..22125d98f9 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Peers/UpdateCachedPeerData.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Peers/UpdateCachedPeerData.swift @@ -236,7 +236,7 @@ func _internal_fetchAndUpdateCachedPeerData(accountPeerId: PeerId, peerId rawPee switch apiBot { case let .connectedBot(flags, botId, recipients): mappedConnectedBot = TelegramAccountConnectedBot( - id: PeerId(botId), + id: PeerId(namespace: Namespaces.Peer.CloudUser, id: PeerId.Id._internalFromInt64Value(botId)), recipients: TelegramBusinessRecipients(apiValue: recipients), canReply: (flags & (1 << 0)) != 0 )