show quote message body when there are attachments

This commit is contained in:
Ryan ZHAO 2021-03-26 11:22:58 +11:00
parent 47dbed606b
commit 2286fb3709
1 changed files with 5 additions and 1 deletions

View File

@ -178,7 +178,9 @@ final class QuoteView : UIView {
imageView.set(.width, to: thumbnailSize)
imageView.set(.height, to: thumbnailSize)
mainStackView.addArrangedSubview(imageView)
body = (thumbnail != nil) ? "Image" : (isAudio ? "Audio" : "Document")
if (body ?? "").isEmpty {
body = (thumbnail != nil) ? "Image" : (isAudio ? "Audio" : "Document")
}
}
// Body label
let bodyLabel = UILabel()
@ -189,9 +191,11 @@ final class QuoteView : UIView {
bodyLabel.attributedText = given(body) { MentionUtilities.highlightMentions(in: $0, isOutgoingMessage: isOutgoing, threadID: threadID, attributes: [:]) }
?? given(attachments.first?.contentType) { NSAttributedString(string: MIMETypeUtil.isAudio($0) ? "Audio" : "Document") } ?? NSAttributedString(string: "Document")
bodyLabel.textColor = textColor
/*
if hasAttachments {
bodyLabel.numberOfLines = 1
}
*/
let bodyLabelSize = bodyLabel.systemLayoutSizeFitting(availableSpace)
// Label stack view
var authorLabelHeight: CGFloat?