浏览代码

Merge pull request #1028 from deltachat/quote_forwarded_messages

don't show sender name in a quoted chat message
bjoern 4 年之前
父节点
当前提交
618b0b8fcb
共有 2 个文件被更改,包括 21 次插入8 次删除
  1. 11 4
      deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift
  2. 10 4
      deltachat-ios/Chat/Views/QuotePreview.swift

+ 11 - 4
deltachat-ios/Chat/Views/Cells/BaseMessageCell.swift

@@ -274,11 +274,18 @@ public class BaseMessageCell: UITableViewCell {
             quoteView.quote.text = quoteText
 
             if let quoteMsg = msg.quoteMessage {
-                let contact = quoteMsg.fromContact
-                quoteView.senderTitle.text = contact.displayName
-                quoteView.senderTitle.textColor = contact.color
-                quoteView.citeBar.backgroundColor = contact.color
                 quoteView.imagePreview.image = quoteMsg.image
+                if quoteMsg.isForwarded {
+                    quoteView.senderTitle.text = String.localized("forwarded_message")
+                    quoteView.senderTitle.textColor = DcColors.grayDateColor
+                    quoteView.citeBar.backgroundColor = DcColors.grayDateColor
+                } else {
+                    let contact = quoteMsg.fromContact
+                    quoteView.senderTitle.text = contact.displayName
+                    quoteView.senderTitle.textColor = contact.color
+                    quoteView.citeBar.backgroundColor = contact.color
+                }
+
             }
         } else {
             quoteView.isHidden = true

+ 10 - 4
deltachat-ios/Chat/Views/QuotePreview.swift

@@ -31,11 +31,17 @@ public class QuotePreview: DraftPreview {
             compactView = draft.attachment != nil
             calculateQuoteHeight(compactView: compactView)
             if let quoteMessage = draft.quoteMessage {
-                let contact = quoteMessage.fromContact
-                quoteView.senderTitle.text = contact.displayName
-                quoteView.senderTitle.textColor = contact.color
-                quoteView.citeBar.backgroundColor = contact.color
                 quoteView.imagePreview.image = quoteMessage.image
+                if quoteMessage.isForwarded {
+                    quoteView.senderTitle.text = String.localized("forwarded_message")
+                    quoteView.senderTitle.textColor = DcColors.grayDateColor
+                    quoteView.citeBar.backgroundColor = DcColors.grayDateColor
+                } else {
+                    let contact = quoteMessage.fromContact
+                    quoteView.senderTitle.text = contact.displayName
+                    quoteView.senderTitle.textColor = contact.color
+                    quoteView.citeBar.backgroundColor = contact.color
+                }
             }
 
             isHidden = false