Explorar el Código

feat: IM 会话列表默认内置官方消息会话

陈文艺 hace 3 meses
padre
commit
3c0627d445

+ 4 - 0
Lanu/Manager/IM/LNIMManager.swift

@@ -59,6 +59,10 @@ extension LNIMManager {
                 if let index = list.firstIndex(where: { $0.userID?.isImOfficialId == true }) {
                     let item = list.remove(at: index)
                     list.insert(item, at: 0)
+                } else {
+                    V2TIMManager.sharedInstance().setConversationDraft(conversationID: "c2c_" + Self.officialId, draftText: " ") {
+                        V2TIMManager.sharedInstance().setConversationDraft(conversationID: "c2c_" + Self.officialId, draftText: nil, succ: nil)
+                    }
                 }
                 
                 conversationList = list

+ 4 - 0
Lanu/Views/IM/ConversationList/LNIMConversationCell.swift

@@ -35,6 +35,10 @@ class LNIMConversationCell: UITableViewCell {
             titleLabel.textColor = .text_5
         }
         messageLabel.attributedText = item.lastDisplayString
+        if messageLabel.attributedText?.string.isEmpty != false,
+           item.userID?.isImOfficialId == true {
+            messageLabel.attributedText = NSAttributedString(string: .init(key: "No message"))
+        }
         timeLabel.text = item.lastDisplayDate?.tencentIMTimeDesc ?? ""
         
         if item.unreadCount > 0 {