Sfoglia il codice sorgente

Merge pull request #1028 from deltachat/quote_forwarded_messages

don't show sender name in a quoted chat message
bjoern 4 anni fa
parent
commit
618b0b8fcb

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

@@ -274,11 +274,18 @@ public class BaseMessageCell: UITableViewCell {
             quoteView.quote.text = quoteText
             quoteView.quote.text = quoteText
 
 
             if let quoteMsg = msg.quoteMessage {
             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
                 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 {
         } else {
             quoteView.isHidden = true
             quoteView.isHidden = true

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

@@ -31,11 +31,17 @@ public class QuotePreview: DraftPreview {
             compactView = draft.attachment != nil
             compactView = draft.attachment != nil
             calculateQuoteHeight(compactView: compactView)
             calculateQuoteHeight(compactView: compactView)
             if let quoteMessage = draft.quoteMessage {
             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
                 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
             isHidden = false