Group boosts

This commit is contained in:
Ilya Laktyushin
2024-02-09 01:05:32 +04:00
parent cad0d5f360
commit b938726fb8
24 changed files with 325 additions and 142 deletions

View File

@@ -900,21 +900,21 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
}
attributedString = addAttributesToStringWithRanges(resultTitleString._tuple, body: bodyAttributes, argumentAttributes: peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: attributePeerIds))
case let .setChatWallpaper(_, forBoth):
var isGroup = false
let messagePeer = message.peers[message.id.peerId]
if let channel = messagePeer as? TelegramChannel, case .group = channel.info {
isGroup = true
}
if message.author?.id == accountPeerId {
if forBoth {
let peerName = message.peers[message.id.peerId].flatMap(EnginePeer.init)?.compactDisplayTitle ?? ""
let resultTitleString = strings.Notification_YouChangedWallpaperBoth(peerName)
attributedString = addAttributesToStringWithRanges(resultTitleString._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes])
} else {
attributedString = NSAttributedString(string: strings.Notification_YouChangedWallpaper, font: titleFont, textColor: primaryTextColor)
attributedString = NSAttributedString(string: isGroup ? strings.Notification_YouChangedGroupWallpaper : strings.Notification_YouChangedWallpaper, font: titleFont, textColor: primaryTextColor)
}
} else {
if message.id.peerId.isGroupOrChannel {
var isGroup = false
let messagePeer = message.peers[message.id.peerId]
if let channel = messagePeer as? TelegramChannel, case .group = channel.info {
isGroup = true
}
attributedString = NSAttributedString(string: isGroup ? strings.Notification_GroupChangedWallpaper : strings.Notification_ChannelChangedWallpaper, font: titleFont, textColor: primaryTextColor)
} else {
let resultTitleString = strings.Notification_ChangedWallpaper(compactAuthorName)