mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user