Synch to No Gnus 200402052146.
authoryamaoka <yamaoka>
Thu, 5 Feb 2004 21:55:52 +0000 (21:55 +0000)
committeryamaoka <yamaoka>
Thu, 5 Feb 2004 21:55:52 +0000 (21:55 +0000)
lisp/ChangeLog
lisp/spam-report.el
lisp/spam.el

index 55a8eb4..0043d7c 100644 (file)
@@ -1,3 +1,15 @@
+2004-02-05  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * spam-report.el (spam-report-process-queue): New function.
+       Process requests from `spam-report-requests-file'.
+
+2004-02-05  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-register-routine)
+       (spam-log-processing-to-registry, spam-log-registered-p)
+       (spam-log-unregistration-needed-p, spam-log-undo-registration):
+       change "check" to "spam-check" for semi-clarity
+
 2004-02-05  Jesper Harder  <harder@ifa.au.dk>
 
        * pop3.el: Require nnheader.
index 2307cc8..b4ed75b 100644 (file)
@@ -125,6 +125,48 @@ the function specified by `spam-report-url-ping-function'."
        (format "GET %s HTTP/1.1\nUser-Agent: %s (spam-report.el)\nHost: %s\n\n"
               report (gnus-emacs-version) host)))))
 
+(defun spam-report-process-queue (&optional file keep)
+  "Report all queued requests from `spam-report-requests-file'.
+
+If KEEP is t, leave old requests in the file.  If KEEP is
+the symbol `ask', query before flushing the queue file."
+  (interactive
+   (list (read-file-name
+         "File: "
+         (file-name-directory spam-report-requests-file)
+         spam-report-requests-file
+         nil
+         (file-name-nondirectory spam-report-requests-file)
+         spam-report-requests-file)
+        current-prefix-arg))
+  (if (eq spam-report-url-ping-function 'spam-report-url-to-file)
+      (error (concat "Cannot process requests when "
+                    "`spam-report-url-ping-function' is "
+                    "`spam-report-url-to-file'"))
+    (gnus-message 7 "Processing requests using `%s'."
+                 spam-report-url-ping-function))
+  (or file (setq file spam-report-requests-file))
+  (save-excursion
+    (set-buffer (find-file-noselect file))
+    (goto-char (point-min))
+    (while (and (not (eobp))
+               (re-search-forward
+                "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
+      (funcall spam-report-url-ping-function (match-string 1) (match-string 2))
+      (forward-line 1))
+    (if (or (eq keep nil)
+           (and (eq keep 'ask)
+                (y-or-n-p
+                 (format
+                  "Flush requests from `%s'? " (current-buffer)))))
+       (progn
+         (gnus-message 7 "Flushing request file `%s'"
+                       spam-report-requests-file)
+         (erase-buffer)
+         (save-buffer)
+         (kill-buffer (current-buffer)))
+      (gnus-message 7 "Keeping requests in `%s'" spam-report-requests-file))))
+
 (defun spam-report-url-ping-mm-url (host report)
   "Ping a host through HTTP, addressing a specific GET resource. Use
 the external program specified in `mm-url-program' to connect to
index a957be2..d28bc9d 100644 (file)
@@ -1248,7 +1248,7 @@ functions")
                            gnus-newsgroup-articles
                            classification)))
        ;; process them
-       (gnus-message 5 "%s %d %s articles with classification %s, check %s"
+       (gnus-message 5 "%s %d %s articles: classification %s, spam-check %s"
                      (if unregister "Unregistering" "Registering")
                      (length articles)
                      (if specific-articles "specific" "")
@@ -1280,8 +1280,10 @@ functions")
           type
           cell-list))
 
-      (gnus-error 5 (format "%s called with bad ID, type, classification, check, or group"
-                           "spam-log-processing-to-registry")))))
+      (gnus-error 
+       5 
+       (format "%s call with bad ID, type, classification, spam-check, or group"
+              "spam-log-processing-to-registry")))))
 
 ;;; check if a ham- or spam-processor registration has been done
 (defun spam-log-registered-p (id type)
@@ -1290,8 +1292,10 @@ functions")
             (spam-process-type-valid-p type))
        (cdr-safe (gnus-registry-fetch-extra id type))
       (progn
-       (gnus-error 5 (format "%s called with bad ID, type, classification, or check"
-                             "spam-log-registered-p"))
+       (gnus-error 
+        5 
+        (format "%s called with bad ID, type, classification, or spam-check"
+                "spam-log-registered-p"))
        nil))))
 
 ;;; check what a ham- or spam-processor registration says
@@ -1326,8 +1330,10 @@ functions")
                (setq found t))))
          found)
       (progn
-       (gnus-error 5 (format "%s called with bad ID, type, classification, or check"
-                             "spam-log-unregistration-needed-p"))
+       (gnus-error 
+        5 
+        (format "%s called with bad ID, type, classification, or spam-check"
+                "spam-log-unregistration-needed-p"))
        nil))))
 
 
@@ -1350,7 +1356,7 @@ functions")
           type
           new-cell-list))
       (progn
-       (gnus-error 5 (format "%s called with bad ID, type, check, or group"
+       (gnus-error 5 (format "%s call with bad ID, type, spam-check, or group"
                              "spam-log-undo-registration"))
        nil))))