* spam.el (spam-ham-copy-or-move-routine): add respooling
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 20 Nov 2003 14:52:28 +0000 (14:52 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 20 Nov 2003 14:52:28 +0000 (14:52 +0000)
support, not working well yet

* gnus.el (ham-process-destination): make 'respool option the
only one, so it can't be chosen together with other groups

lisp/ChangeLog
lisp/gnus.el
lisp/spam.el

index c2e70d5..ade3500 100644 (file)
@@ -1,3 +1,11 @@
+2003-11-20  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-ham-copy-or-move-routine): add respooling
+       support, not working well yet
+
+       * gnus.el (ham-process-destination): make 'respool option the
+       only one, so it can't be chosen together with other groups
+
 2003-11-19  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-track-extra): make it a set of
index d4f2193..236fdac 100644 (file)
@@ -1975,9 +1975,7 @@ mail groups."
      :tag "Destination for ham articles at summary exit from a spam group"
      (string :tag "Move to a group")
      (repeat :tag "Move to multiple groups"
-            (choice
-             (string :tag "Destination group")
-             (const  :tag "Respool" respool)))
+            (string :tag "Destination group"))
      (const :tag "Respool" respool)
      (const :tag "Do nothing" nil))
    :function-document
@@ -2001,9 +1999,7 @@ mail groups, and only works in spam groups."
        :tag "Destination for ham articles at summary exit from spam group"
        (string :tag "Move to a group")
        (repeat :tag "Move to multiple groups"
-              (choice
-               (string :tag "Destination group")
-               (const  :tag "Respool" respool)))
+               (string :tag "Destination group"))
        (const :tag "Respool" respool)
        (const :tag "Expire" nil))))
    :parameter-document
index edba39f..b01ca6c 100644 (file)
@@ -603,12 +603,17 @@ spamoracle database."
        (backend-supports-deletions
         (gnus-check-backend-function
          'request-move-article gnus-newsgroup-name))
-       article mark todo deletep)
+       (respool-method (gnus-find-method-for-group gnus-newsgroup-name))
+       article mark todo deletep respool)
     (dolist (article articles)
       (when (spam-group-ham-mark-p gnus-newsgroup-name
                                   (gnus-summary-article-mark article))
        (push article todo)))
 
+    (when (member 'respool groups)
+      (setq respool t)                 ; boolean for later
+      (setq groups '("fake"))) ; when respooling, groups are dynamic so fake it
+
     ;; now do the actual move
     (dolist (group groups)
       (when (and todo (stringp group))
@@ -617,12 +622,14 @@ spamoracle database."
            (gnus-summary-mark-article article gnus-unread-mark))
          (gnus-summary-set-process-mark article))
 
-       (if (or (not backend-supports-deletions)
-               (> (length groups) 1))
-           (progn 
-             (gnus-summary-copy-article nil group)
-             (setq deletep t))
-         (gnus-summary-move-article nil group))))
+       (if respool                        ; respooling is with a "fake" group
+           (gnus-summary-respool-article nil respool-method)
+         (if (or (not backend-supports-deletions) ; else, we are not respooling
+                 (> (length groups) 1))
+             (progn                    ; if copying, copy and set deletep
+               (gnus-summary-copy-article nil group)
+               (setq deletep t))
+           (gnus-summary-move-article nil group))))) ; else move articles
     
     ;; now delete the articles, unless a) copy is t, and there was a copy done
     ;;                                 b) a move was done to a single group