Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin
2025-06-13 18:19:08 +02:00
50 changed files with 1219 additions and 140 deletions

View File

@@ -1388,6 +1388,48 @@ public func universalServiceMessageString(presentationData: (PresentationTheme,
}
attributedString = addAttributesToStringWithRanges(resultString._tuple, body: bodyAttributes, argumentAttributes: attributes)
}
case let .suggestedPostApprovalStatus(status):
//TODO:localize
var messageText = ""
for attribute in message.attributes {
if let attribute = attribute as? ReplyMessageAttribute, let message = message.associatedMessages[attribute.messageId] {
messageText = message.text
}
}
let string: String
if !message.flags.contains(.Incoming) {
switch status {
case .approved:
if messageText.isEmpty {
string = "The message was approved"
} else {
string = "The message \"\(messageText)\" was approved"
}
case .rejected:
if messageText.isEmpty {
string = "The message was declined"
} else {
string = "The message \"\(messageText)\" was declined"
}
}
} else {
switch status {
case .approved:
if messageText.isEmpty {
string = "Your message was approved"
} else {
string = "Your message \"\(messageText)\" was approved"
}
case .rejected:
if messageText.isEmpty {
string = "Your message was declined"
} else {
string = "Your message \"\(messageText)\" was declined"
}
}
}
attributedString = NSAttributedString(string: string, font: titleFont, textColor: primaryTextColor)
case .unknown:
attributedString = nil
}