Initial peer custom wallpapers implementation

This commit is contained in:
Ilya Laktyushin
2023-03-31 23:44:19 +04:00
parent c851ec3046
commit 330fcfa5cd
31 changed files with 863 additions and 167 deletions

View File

@@ -873,6 +873,13 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
let botName = message.peers[message.id.peerId].flatMap(EnginePeer.init)?.displayTitle(strings: strings, displayOrder: nameDisplayOrder) ?? ""
let peerName = message.peers[peerId].flatMap(EnginePeer.init)?.displayTitle(strings: strings, displayOrder: nameDisplayOrder) ?? ""
attributedString = addAttributesToStringWithRanges(strings.Notification_RequestedPeer(peerName, botName)._tuple, body: bodyAttributes, argumentAttributes: peerMentionsAttributes(primaryTextColor: primaryTextColor, peerIds: [(0, peerId), (1, message.id.peerId)]))
case .setChatWallpaper:
if message.author?.id == accountPeerId {
attributedString = NSAttributedString(string: strings.Notification_YouChangedWallpaper, font: titleFont, textColor: primaryTextColor)
} else {
let resultTitleString = strings.Notification_ChangedWallpaper(authorName)
attributedString = addAttributesToStringWithRanges(resultTitleString._tuple, body: bodyAttributes, argumentAttributes: [0: boldAttributes])
}
case .unknown:
attributedString = nil
}