From: Lars Magne Ingebrigtsen Date: Tue, 21 Sep 2010 18:18:41 +0000 (+0200) Subject: (nnimap-mark-and-expunge-incoming): Wait for the last sequence. X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=867ffe85879c826853492ca61aa567794de3d184;hp=6dafc26144aa92112682142ec3163867ab0e5f79;p=gnus (nnimap-mark-and-expunge-incoming): Wait for the last sequence. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9ceb3a886..92ee1d9f5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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. diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 2d875ac88..99c243fd9 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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)