瀏覽代碼

contact cell now updates contacts avatar image if needed

nayooti 5 年之前
父節點
當前提交
bdc3a65c90
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      deltachat-ios/View/ContactCell.swift

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

@@ -279,8 +279,12 @@ class ContactCell: UITableViewCell {
         case .contact(let contactData):
             let contact = DcContact(id: contactData.contactId)
             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)
         }
     }