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