Browse Source

contact cell now updates contacts avatar image if needed

nayooti 5 năm trước cách đây
mục cha
commit
bdc3a65c90

+ 6 - 2
deltachat-ios/View/ContactCell.swift

@@ -279,8 +279,12 @@ class ContactCell: UITableViewCell {
         case .contact(let contactData):
         case .contact(let contactData):
             let contact = DcContact(id: contactData.contactId)
             let contact = DcContact(id: contactData.contactId)
             titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
             titleLabel.attributedText = cellViewModel.title.boldAt(indexes: cellViewModel.titleHighlightIndexes, fontSize: titleLabel.font.pointSize)
-            avatar.setName(cellViewModel.title)
-            avatar.setColor(contact.color)
+            if let profileImage = contact.profileImage {
+                avatar.setImage(profileImage)
+            } else {
+                avatar.setName(cellViewModel.title)
+                avatar.setColor(contact.color)
+            }
             setStatusIndicators(unreadCount: 0, status: 0, visibility: 0, isLocationStreaming: false)
             setStatusIndicators(unreadCount: 0, status: 0, visibility: 0, isLocationStreaming: false)
         }
         }
     }
     }