X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fspam.el;h=adb83c79f61ef3ffd7e81eb782cd4fd90a9b9977;hb=13fedf515a4498dba4f9f2cfd16913650260e3c7;hp=163402740e98b36c3829c50b4aa63b829cd6bc4f;hpb=ac6c2157fc36f4faffa7aa1b01557559d286da90;p=elisp%2Fgnus.git- diff --git a/lisp/spam.el b/lisp/spam.el index 1634027..adb83c7 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -861,11 +861,14 @@ Will not return a nil score." (unless (and spam-move-spam-nonspam-groups-only (spam-group-spam-contents-p gnus-newsgroup-name)) - (gnus-message 6 "Marking spam as expired and moving it to %s" - (gnus-parameter-spam-process-destination - gnus-newsgroup-name)) - (spam-mark-spam-as-expired-and-move-routine - (gnus-parameter-spam-process-destination gnus-newsgroup-name))) + (when (< 0 (length (spam-list-articles + gnus-newsgroup-articles + 'spam))) + (gnus-message 6 "Marking spam as expired and moving it to %s" + (gnus-parameter-spam-process-destination + gnus-newsgroup-name)) + (spam-mark-spam-as-expired-and-move-routine + (gnus-parameter-spam-process-destination gnus-newsgroup-name)))) ;; now we redo spam-mark-spam-as-expired-and-move-routine to only ;; expire spam, in case the above did not expire them @@ -888,16 +891,19 @@ Will not return a nil score." (spam-group-processor-p gnus-newsgroup-name processor)) (spam-register-routine classification check))))) - (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) - (gnus-message 6 "Copying ham") - (spam-ham-copy-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name))) - - ;; now move all ham articles out of spam groups - (when (spam-group-spam-contents-p gnus-newsgroup-name) - (gnus-message 6 "Moving ham messages from spam group") - (spam-ham-move-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name)))) + (when (< 0 (length (spam-list-articles + gnus-newsgroup-articles + 'ham))) + (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) + (gnus-message 6 "Copying ham") + (spam-ham-copy-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name))) + + ;; now move all ham articles out of spam groups + (when (spam-group-spam-contents-p gnus-newsgroup-name) + (gnus-message 6 "Moving ham messages from spam group") + (spam-ham-move-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name))))) (setq spam-old-ham-articles nil) (setq spam-old-spam-articles nil))