(spam-summary-prepare-exit): fix messages, so they show
authorTeodor Zlatanov <tzz@lifelogs.com>
Mon, 17 May 2004 14:28:21 +0000 (14:28 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Mon, 17 May 2004 14:28:21 +0000 (14:28 +0000)
only when there is spam or ham to be processed

lisp/ChangeLog
lisp/spam.el

index 608d486..02ca1d5 100644 (file)
@@ -1,3 +1,8 @@
+2004-05-17  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-summary-prepare-exit): fix messages, so they show
+       only when there is spam or ham to be processed
+
 2004-05-17  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * mail-source.el (mail-source-delete-crash-box): Refactor.
index 8fc286d..a9099ac 100644 (file)
@@ -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))