Browse Source

Merge pull request #1328 from deltachat/fix_drafts

don't add message on DC_EVENT_MSGS_CHANGED if message is a draft
bjoern 3 years ago
parent
commit
0aa516ba05
1 changed files with 2 additions and 1 deletions
  1. 2 1
      deltachat-ios/Chat/ChatViewController.swift

+ 2 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -1266,7 +1266,8 @@ class ChatViewController: UITableViewController {
         } else {
         } else {
             // new outgoing message
             // new outgoing message
             let msg = dcContext.getMessage(id: messageId)
             let msg = dcContext.getMessage(id: messageId)
-            if msg.chatId == chatId {
+            if msg.state != DC_STATE_OUT_DRAFT,
+               msg.chatId == chatId {
                 if let newMsgMarkerIndex = messageIds.index(of: Int(DC_MSG_ID_MARKER1)) {
                 if let newMsgMarkerIndex = messageIds.index(of: Int(DC_MSG_ID_MARKER1)) {
                     messageIds.remove(at: newMsgMarkerIndex)
                     messageIds.remove(at: newMsgMarkerIndex)
                 }
                 }