TODO: Show caption in details

TODO:
- [ ] layout is shite

// FREEBIE
pull/1/head
sdkjfhsdkjhfsdlkjhfsdf 7 years ago
parent 0e9c9a9bb3
commit 411de65b40

@ -305,9 +305,7 @@ class MessageDetailViewController: OWSViewController, UIScrollViewDelegate {
}
private func displayableTextIfText() -> String? {
let messageCellType = viewItem.messageCellType()
guard messageCellType == .textMessage ||
messageCellType == .oversizeTextMessage else {
guard viewItem.hasText else {
return nil
}
guard let displayableText = viewItem.displayableText() else {
@ -327,6 +325,10 @@ class MessageDetailViewController: OWSViewController, UIScrollViewDelegate {
private func contentRows() -> [UIView] {
var rows = [UIView]()
if message.attachmentIds.count > 0 {
rows += addAttachmentRows()
}
if let messageBody = displayableTextIfText() {
self.messageBody = messageBody
@ -382,9 +384,9 @@ class MessageDetailViewController: OWSViewController, UIScrollViewDelegate {
bubbleView.autoPinEdge(toSuperviewEdge: isIncoming ? .leading : .trailing, withInset: bubbleViewHMargin)
self.bubbleViewWidthConstraint = bubbleView.autoSetDimension(.width, toSize:0)
rows.append(row)
} else if message.attachmentIds.count > 0 {
rows += addAttachmentRows()
} else {
}
if rows.count == 0 {
// Neither attachment nor body.
owsFail("\(self.TAG) Message has neither attachment nor body.")
rows.append(valueRow(name: NSLocalizedString("MESSAGE_METADATA_VIEW_NO_ATTACHMENT_OR_BODY",

Loading…
Cancel
Save