Various fixes

This commit is contained in:
Ilya Laktyushin 2025-09-01 01:04:55 +04:00
parent 975430aa85
commit 3532aad036
3 changed files with 13 additions and 1 deletions

View File

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

View File

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

View File

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