From: Lars Magne Ingebrigtsen Date: Tue, 21 Sep 2010 18:11:11 +0000 (+0200) Subject: Request the article before looking at what the Message-ID is. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=6dafc26144aa92112682142ec3163867ab0e5f79 Request the article before looking at what the Message-ID is. Fix found by Andrew Cohen. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c67747651..9ceb3a886 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,8 @@ * nnimap.el (nnimap-find-expired-articles): New function. (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. * 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 a5d371422..2d875ac88 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -466,27 +466,27 @@ textual parts.") (deffoo nnimap-request-move-article (article group server accept-form &optional last internal-move-group) - (when (nnimap-possibly-change-group group server) - ;; If the move is internal (on the same server), just do it the easy - ;; way. - (let ((message-id (message-field-value "message-id"))) - (if internal-move-group - (let ((result - (with-current-buffer (nnimap-buffer) - (nnimap-command "UID COPY %d %S" - article - (utf7-encode internal-move-group t))))) - (when (car result) - (nnimap-delete-article article) - (cons internal-move-group - (nnimap-find-article-by-message-id - internal-move-group message-id)))) - (with-temp-buffer - (when (nnimap-request-article article group server (current-buffer)) - (let ((result (eval accept-form))) - (when result + (with-temp-buffer + (when (nnimap-request-article article group server (current-buffer)) + ;; If the move is internal (on the same server), just do it the easy + ;; way. + (let ((message-id (message-field-value "message-id"))) + (if internal-move-group + (let ((result + (with-current-buffer (nnimap-buffer) + (nnimap-command "UID COPY %d %S" + article + (utf7-encode internal-move-group t))))) + (when (car result) (nnimap-delete-article article) - result)))))))) + (cons internal-move-group + (nnimap-find-article-by-message-id + internal-move-group message-id)))) + ;; Move the article to a different method. + (let ((result (eval accept-form))) + (when result + (nnimap-delete-article article) + result))))))) (deffoo nnimap-request-expire-articles (articles group &optional server force) (cond