Various improvements

This commit is contained in:
Ilya Laktyushin
2023-12-17 21:22:01 +04:00
parent 3314a18165
commit 7f0aff80f0
10 changed files with 79 additions and 27 deletions

View File

@@ -61,7 +61,7 @@ private func monthAtIndex(_ index: Int, strings: PresentationStrings) -> String
}
}
public func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Message, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, strings: PresentationStrings, format: MessageTimestampStatusFormat = .regular, associatedData: ChatMessageItemAssociatedData) -> String {
public func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Message, dateTimeFormat: PresentationDateTimeFormat, nameDisplayOrder: PresentationPersonNameOrder, strings: PresentationStrings, format: MessageTimestampStatusFormat = .regular, associatedData: ChatMessageItemAssociatedData, ignoreAuthor: Bool = false) -> String {
if let adAttribute = message.adAttribute {
switch adAttribute.messageType {
case .sponsored:
@@ -155,6 +155,9 @@ public func stringForMessageTimestampStatus(accountPeerId: PeerId, message: Mess
if let subject = associatedData.subject, case let .messageOptions(_, _, info) = subject, case .forward = info {
authorTitle = nil
}
if ignoreAuthor {
authorTitle = nil
}
if case .minimal = format {