(nnimap-mark-and-expunge-incoming): Wait for the last sequence.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 21 Sep 2010 18:18:41 +0000 (20:18 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 21 Sep 2010 18:18:41 +0000 (20:18 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 9ceb3a8..92ee1d9 100644 (file)
@@ -4,6 +4,7 @@
        (nnimap-process-expiry-targets): New function.
        (nnimap-request-move-article): Request the article before looking at
        what the Message-ID is.  Fix found by Andrew Cohen.
+       (nnimap-mark-and-expunge-incoming): Wait for the last sequence.
 
        * nnmail.el (nnmail-expired-article-p): Allow returning the cutoff time
        for oldness in addition to being a predicate.
index 2d875ac..99c243f 100644 (file)
@@ -1112,17 +1112,19 @@ textual parts.")
 (defun nnimap-mark-and-expunge-incoming (range)
   (when range
     (setq range (nnimap-article-ranges range))
-    (nnimap-send-command
-     "UID STORE %s +FLAGS.SILENT (\\Deleted)" range)
-    (cond
-     ;; If the server supports it, we now delete the message we have
-     ;; just copied over.
-     ((member "UIDPLUS" (nnimap-capabilities nnimap-object))
-      (nnimap-send-command "UID EXPUNGE %s" range))
-     ;; If it doesn't support UID EXPUNGE, then we only expunge if the
-     ;; user has configured it.
-     (nnimap-expunge-inbox
-      (nnimap-send-command "EXPUNGE")))))
+    (let ((sequence
+          (nnimap-send-command
+           "UID STORE %s +FLAGS.SILENT (\\Deleted)" range)))
+      (cond
+       ;; If the server supports it, we now delete the message we have
+       ;; just copied over.
+       ((member "UIDPLUS" (nnimap-capabilities nnimap-object))
+       (setq sequence (nnimap-send-command "UID EXPUNGE %s" range)))
+       ;; If it doesn't support UID EXPUNGE, then we only expunge if the
+       ;; user has configured it.
+       (nnimap-expunge-inbox
+       (setq sequence (nnimap-send-command "EXPUNGE"))))
+      (nnimap-wait-for-sequence sequence))))
 
 (defun nnimap-parse-copied-articles (sequences)
   (let (sequence copied range)