mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Monoforums
This commit is contained in:
@@ -1262,21 +1262,28 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
|
||||
let starsString = strings.Notification_PaidMessagePriceChanged_Stars(Int32(stars))
|
||||
if message.author?.id == accountPeerId {
|
||||
let resultString: PresentationStrings.FormattedString
|
||||
if broadcastMessagesAllowed {
|
||||
resultString = strings.Notification_PaidMessagePriceChangedAndEnabledChannelMessageYou(starsString)
|
||||
} else {
|
||||
resultString = strings.Notification_PaidMessagePriceChangedYou(starsString)
|
||||
}
|
||||
resultString = strings.Notification_PaidMessagePriceChangedYou(starsString)
|
||||
attributedString = addAttributesToStringWithRanges(resultString._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes])
|
||||
} else {
|
||||
let peerName = message.author?.compactDisplayTitle ?? ""
|
||||
var attributes = peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: [(0, message.author?.id)])
|
||||
attributes[1] = boldAttributes
|
||||
let resultString: PresentationStrings.FormattedString
|
||||
|
||||
if broadcastMessagesAllowed {
|
||||
resultString = strings.Notification_PaidMessagePriceChangedAndEnabledChannelMessage(peerName, starsString)
|
||||
if stars == 0 {
|
||||
resultString = strings.Notification_ChannelMessagePriceZeroChanged(peerName)
|
||||
} else {
|
||||
var rawString = strings.Notification_ChannelMessagePriceChanged(Int32(stars))
|
||||
rawString = rawString.replacingOccurrences(of: "{name}", with: peerName)
|
||||
resultString = PresentationStrings.FormattedString(string: rawString, ranges: [])
|
||||
}
|
||||
} else {
|
||||
resultString = strings.Notification_PaidMessagePriceChanged(peerName, starsString)
|
||||
if let channel = message.peers[message.id.peerId] as? TelegramChannel, case .broadcast = channel.info {
|
||||
resultString = strings.Notification_ChannelMessageDisabled(peerName)
|
||||
} else {
|
||||
resultString = strings.Notification_PaidMessagePriceChanged(peerName, starsString)
|
||||
}
|
||||
}
|
||||
attributedString = addAttributesToStringWithRanges(resultString._tuple, body: bodyAttributes, argumentAttributes: attributes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user