Fix archive text when last message is a voice call

This commit is contained in:
Peter 2019-07-09 19:45:53 +04:00
parent 357e11d1e4
commit ad8596028d

View File

@ -4,7 +4,7 @@ import TelegramCore
import TelegramPresentationData
import TelegramUIPreferences
public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, message: Message?, chatPeer: RenderedPeer, accountPeerId: PeerId, enableMediaEmoji: Bool = true) -> (peer: Peer?, hideAuthor: Bool, messageText: String) {
public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder: PresentationPersonNameOrder, message: Message?, chatPeer: RenderedPeer, accountPeerId: PeerId, enableMediaEmoji: Bool = true, isPeerGroup: Bool = false) -> (peer: Peer?, hideAuthor: Bool, messageText: String) {
let peer: Peer?
var hideAuthor = false
@ -121,9 +121,9 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder:
case let invoice as TelegramMediaInvoice:
messageText = invoice.title
case let action as TelegramMediaAction:
hideAuthor = true
switch action.action {
case let .phoneCall(_, discardReason, _):
hideAuthor = !isPeerGroup
let incoming = message.flags.contains(.Incoming)
if let discardReason = discardReason {
switch discardReason {
@ -144,6 +144,7 @@ public func chatListItemStrings(strings: PresentationStrings, nameDisplayOrder:
}
}
default:
hideAuthor = true
if let text = plainServiceMessageString(strings: strings, nameDisplayOrder: nameDisplayOrder, message: message, accountPeerId: accountPeerId) {
messageText = text
}