Skip to content

Commit b41ec12

Browse files
committed
Various fixes
1 parent d156e55 commit b41ec12

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

submodules/TelegramStringFormatting/Sources/ServiceMessageStrings.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,8 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
845845
case let .giftStars(currency, amount, count, _, _, _):
846846
let _ = count
847847
if !forAdditionalServiceMessage {
848-
attributedString = NSAttributedString(string: strings.Notification_Gift, font: titleFont, textColor: primaryTextColor)
848+
let starsPrice = strings.Notification_GiftStars_Stars(Int32(clamping: count))
849+
attributedString = NSAttributedString(string: strings.Notification_GiftStars(starsPrice).string, font: titleFont, textColor: primaryTextColor)
849850
} else {
850851
let price = formatCurrencyAmount(amount, currency: currency)
851852
if message.author?.id == accountPeerId {
@@ -1176,9 +1177,6 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
11761177
if isPrepaidUpgrade {
11771178
let starsPrice = strings.Notification_PrepaidGiftUpgrade_Stars(Int32(clamping: upgradeStars ?? 0))
11781179
attributedString = NSAttributedString(string: strings.Notification_PrepaidGiftUpgrade(starsPrice).string, font: titleFont, textColor: primaryTextColor)
1179-
} else if case let .generic(gift) = gift {
1180-
let starsPrice = strings.Notification_GiftStars_Stars(Int32(clamping: gift.price))
1181-
attributedString = NSAttributedString(string: strings.Notification_GiftStars(starsPrice).string, font: titleFont, textColor: primaryTextColor)
11821180
} else {
11831181
attributedString = NSAttributedString(string: strings.Notification_Gift, font: titleFont, textColor: primaryTextColor)
11841182
}

0 commit comments

Comments
 (0)