Synch to No Gnus 200403042005.
authoryamaoka <yamaoka>
Thu, 4 Mar 2004 23:48:38 +0000 (23:48 +0000)
committeryamaoka <yamaoka>
Thu, 4 Mar 2004 23:48:38 +0000 (23:48 +0000)
lisp/ChangeLog
lisp/gnus-int.el
lisp/gnus.el
lisp/spam.el

index eac6efd..1d41c48 100644 (file)
@@ -1,3 +1,25 @@
+2004-03-04  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-use-gmane-xref): new backend
+       (spam-gmane-xref-spam-group): variable to control the name of the
+       Gmane spam group
+       (spam-blackhole-servers, spam-blackhole-good-server-regex)
+       (spam-regex-headers-spam, spam-regex-headers-ham)
+       (spam-regex-body-spam, spam-regex-body-ham): clarified docs
+       (spam-list-of-checks): added spam-use-gmane-xref to list of
+       backends and checks
+       (spam-check-gmane-xref): function for spam-use-gmane-xref
+
+       * gnus.el (spam-autodetect-methods): add spam-use-gmane-xref as
+       an autodetect method
+
+2004-03-04  Kevin Greiner <kgreiner@xpediantsolutions.com>
+
+       * gnus-int.el (gnus-request-accept-article): Inform the agent that
+       articles are being added to a group.
+       (gnus-request-replace-article): Inform the agent that articles
+       need to be uncached as the cached contents are no longer valid.
+       
 2004-03-04  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * binhex.el: Don't autoload executable-find.
@@ -38,7 +60,7 @@
 
        * uudecode.el: Don't autoload executable-find.
 
-2004-03-02  Kevin Greiner <kgreiner@xpediantsolutions.com>
+2004-03-04  Kevin Greiner <kgreiner@xpediantsolutions.com>
 
         * gnus-agent.el (gnus-agent-file-header-cache): Removed.
        (gnus-agent-possibly-alter-active): Avoid null in numeric
index 8a2356a..c25727c 100644 (file)
@@ -579,21 +579,28 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
     (setq gnus-command-method (gnus-server-to-method gnus-command-method)))
   (when (and (not gnus-command-method)
             (stringp group))
-    (setq gnus-command-method (gnus-group-name-to-method group)))
+    (setq gnus-command-method (or (gnus-find-method-for-group group)
+                                  (gnus-group-name-to-method group))))
   (goto-char (point-max))
   (unless (bolp)
     (insert "\n"))
   (let ((gnus-command-method (or gnus-command-method
-                                (gnus-find-method-for-group group))))
-    (funcall (gnus-get-function gnus-command-method 'request-accept-article)
+                                (gnus-find-method-for-group group)))
+    (result (funcall (gnus-get-function gnus-command-method 'request-accept-article)
             (if (stringp group) (gnus-group-real-name group) group)
             (cadr gnus-command-method)
             last)))
+    (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
+      (gnus-agent-regenerate-group group (list (cdr result))))
+    result))
 
 (defun gnus-request-replace-article (article group buffer &optional no-encode)
-  (let ((func (car (gnus-group-name-to-method group))))
-    (funcall (intern (format "%s-request-replace-article" func))
-            article (gnus-group-real-name group) buffer)))
+  (let* ((func (car (gnus-group-name-to-method group)))
+        (result (funcall (intern (format "%s-request-replace-article" func))
+                         article (gnus-group-real-name group) buffer)))
+    (when (and gnus-agent (gnus-agent-method-p gnus-command-method))
+      (gnus-agent-regenerate-group group (list article)))
+    result))
 
 (defun gnus-request-associate-buffer (group)
   (let ((gnus-command-method (gnus-find-method-for-group group)))
index 2f9cc0d..cca8485 100644 (file)
@@ -2029,6 +2029,7 @@ spam-autodetect-recheck-messages is set.")
      (const default)
      (set :tag "Use specific methods"
          (variable-item spam-use-blacklist)
+         (variable-item spam-use-gmane-xref)
          (variable-item spam-use-regex-headers)
          (variable-item spam-use-regex-body)
          (variable-item spam-use-whitelist)
@@ -2062,6 +2063,7 @@ set."
        (const default)
        (set :tag "Use specific methods"
        (variable-item spam-use-blacklist)
+       (variable-item spam-use-gmane-xref)
        (variable-item spam-use-regex-headers)
        (variable-item spam-use-regex-body)
        (variable-item spam-use-whitelist)
index aa4ff13..f2a1abc 100644 (file)
@@ -162,6 +162,11 @@ The regular expression is matched against the address."
   :type 'boolean
   :group 'spam)
 
+(defcustom spam-use-gmane-xref nil
+  "Whether the Gmane spam xref should be used by `spam-split'."
+  :type 'boolean
+  :group 'spam)
+
 (defcustom spam-use-blacklist nil
   "Whether the blacklist should be used by `spam-split'."
   :type 'boolean
@@ -260,6 +265,7 @@ them."
 
 (defcustom spam-install-hooks (or
                               spam-use-dig
+                              spam-use-gmane-xref
                               spam-use-blacklist
                               spam-use-whitelist
                               spam-use-whitelist-exclusive
@@ -296,14 +302,23 @@ All unmarked article in such group receive the spam mark on group entry."
   :type '(repeat (string :tag "Group"))
   :group 'spam)
 
+
+(defcustom spam-gmane-xref-spam-group "gmane.spam.detected"
+  "The group where spam xrefs can be found on Gmane.
+Only meaningful if you enable `spam-use-gmane-xref'."
+  :type 'string
+  :group 'spam)
+
 (defcustom spam-blackhole-servers '("bl.spamcop.net" "relays.ordb.org"
                                    "dev.null.dk" "relays.visi.com")
-  "List of blackhole servers."
+  "List of blackhole servers.
+Only meaningful if you enable `spam-use-blackholes'."
   :type '(repeat (string :tag "Server"))
   :group 'spam)
 
 (defcustom spam-blackhole-good-server-regex nil
-  "String matching IP addresses that should not be checked in the blackholes."
+  "String matching IP addresses that should not be checked in the blackholes.
+Only meaningful if you enable `spam-use-blackholes'."
   :type '(radio (const nil)
                (regexp :format "%t: %v\n" :size 0))
   :group 'spam)
@@ -314,22 +329,26 @@ All unmarked article in such group receive the spam mark on group entry."
   :group 'spam)
 
 (defcustom spam-regex-headers-spam '("^X-Spam-Flag: YES")
-  "Regular expression for positive header spam matches."
+  "Regular expression for positive header spam matches.
+Only meaningful if you enable `spam-use-regex-headers'."
   :type '(repeat (regexp :tag "Regular expression to match spam header"))
   :group 'spam)
 
 (defcustom spam-regex-headers-ham '("^X-Spam-Flag: NO")
-  "Regular expression for positive header ham matches."
+  "Regular expression for positive header ham matches.
+Only meaningful if you enable `spam-use-regex-headers'."
   :type '(repeat (regexp :tag "Regular expression to match ham header"))
   :group 'spam)
 
 (defcustom spam-regex-body-spam '()
-  "Regular expression for positive body spam matches."
+  "Regular expression for positive body spam matches.
+Only meaningful if you enable `spam-use-regex-body'."
   :type '(repeat (regexp :tag "Regular expression to match spam body"))
   :group 'spam)
 
 (defcustom spam-regex-body-ham '()
-  "Regular expression for positive body ham matches."
+  "Regular expression for positive body ham matches.
+Only meaningful if you enable `spam-use-regex-body'."
   :type '(repeat (regexp :tag "Regular expression to match ham body"))
   :group 'spam)
 
@@ -960,6 +979,7 @@ Respects the process/prefix convention."
 (defvar spam-list-of-checks
   '((spam-use-blacklist                .       spam-check-blacklist)
     (spam-use-regex-headers            .       spam-check-regex-headers)
+    (spam-use-gmane-xref               .       spam-check-gmane-xref)
     (spam-use-regex-body               .       spam-check-regex-body)
     (spam-use-whitelist                .       spam-check-whitelist)
     (spam-use-BBDB                     .       spam-check-BBDB)
@@ -1372,6 +1392,20 @@ functions")
       (setq nnimap-split-download-body-default t))))
 
 \f
+;;;; Gmane xrefs
+(defun spam-check-gmane-xref ()
+  (let ((header (or
+                (message-fetch-field "Xref")
+                (message-fetch-field "Newsgroups")))
+       (spam-split-group (if spam-split-symbolic-return
+                             'spam
+                           spam-split-group)))
+    (when header                       ; return nil when no header
+      (when (string-match spam-gmane-xref-spam-group
+                         header)
+         spam-split-group))))
+
+\f
 ;;;; Regex body
 
 (defun spam-check-regex-body ()