Request the article before looking at what the Message-ID is.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 21 Sep 2010 18:11:11 +0000 (20:11 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 21 Sep 2010 18:11:11 +0000 (20:11 +0200)
Fix found by Andrew Cohen.

lisp/ChangeLog
lisp/nnimap.el

index c677476..9ceb3a8 100644 (file)
@@ -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.
index a5d3714..2d875ac 100644 (file)
@@ -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