From 3532aad036aeb115877259fe76a6c9eefdfc5a26 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Mon, 1 Sep 2025 01:04:55 +0400 Subject: [PATCH] Various fixes --- Telegram/Telegram-iOS/en.lproj/Localizable.strings | 4 ++++ .../Sources/ServiceMessageStrings.swift | 7 ++++++- submodules/TelegramUI/Sources/ChatController.swift | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Telegram/Telegram-iOS/en.lproj/Localizable.strings b/Telegram/Telegram-iOS/en.lproj/Localizable.strings index 7949042e9f..1bf76e5a2a 100644 --- a/Telegram/Telegram-iOS/en.lproj/Localizable.strings +++ b/Telegram/Telegram-iOS/en.lproj/Localizable.strings @@ -14996,3 +14996,7 @@ Sorry for the inconvenience."; "Gift.Value.ForSaleOnFragment" = "for sale on Fragment"; "Gift.View.Context.SetAsTheme" = "Set as Theme in..."; + +"Notification.PrepaidGiftUpgrade" = "Gift Upgrade for %@"; +"Notification.PrepaidGiftUpgrade.Stars_1" = "%@ Star"; +"Notification.PrepaidGiftUpgrade.Stars_any" = "%@ Stars"; diff --git a/submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift b/submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift index a13b4239ea..c375006deb 100644 --- a/submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift +++ b/submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift @@ -1173,7 +1173,12 @@ public func universalServiceMessageString(presentationData: (PresentationTheme, let mutableAttributedString = NSMutableAttributedString(attributedString: stringWithAppliedEntities(text, entities: entities ?? [], baseColor: primaryTextColor, linkColor: primaryTextColor, baseFont: titleFont, linkFont: titleBoldFont, boldFont: titleBoldFont, italicFont: titleFont, boldItalicFont: titleBoldFont, fixedFont: titleFont, blockQuoteFont: titleFont, underlineLinks: false, message: message._asMessage())) attributedString = mutableAttributedString } else { - attributedString = NSAttributedString(string: strings.Notification_Gift, font: titleFont, textColor: primaryTextColor) + if isPrepaidUpgrade { + let starsPrice = strings.Notification_PrepaidGiftUpgrade_Stars(Int32(clamping: upgradeStars ?? 0)) + attributedString = NSAttributedString(string: strings.Notification_PrepaidGiftUpgrade(starsPrice).string, font: titleFont, textColor: primaryTextColor) + } else { + attributedString = NSAttributedString(string: strings.Notification_Gift, font: titleFont, textColor: primaryTextColor) + } } } else if case let .generic(gift) = gift { var finalPrice = gift.price diff --git a/submodules/TelegramUI/Sources/ChatController.swift b/submodules/TelegramUI/Sources/ChatController.swift index 70d9760246..70c2e024cd 100644 --- a/submodules/TelegramUI/Sources/ChatController.swift +++ b/submodules/TelegramUI/Sources/ChatController.swift @@ -5831,6 +5831,9 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G } } case .gift: + if let darkAppearancePreview = darkAppearancePreview { + useDarkAppearance = darkAppearancePreview + } if let theme = makePresentationTheme(chatTheme: chatTheme, dark: useDarkAppearance) { theme.forceSync = true presentationData = presentationData.withUpdated(theme: theme).withUpdated(chatWallpaper: theme.chat.defaultWallpaper)