[gnus git] branch master updated: n0-17-345-gdb7eb92 =1= * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching. Drop `bbdb-cache'.

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  db7eb926d777947d15aed7aed0f722fdebe9dec5 (commit)
      from  92e9c620b48a080bda4fc801e3f63378437ed78b (commit)


- Log -----------------------------------------------------------------
commit db7eb926d777947d15aed7aed0f722fdebe9dec5
Author: Ted Zlatanov <[email protected]>
Date:   Tue Oct 11 05:36:50 2011 -0400

    * spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when searching.  Drop `bbdb-cache'.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 83243e7..2a109ca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-11  Teodor Zlatanov  <[email protected]>
+
+	* spam.el (spam-check-BBDB): Simplify and support BBDB 3.x when
+	searching.  Drop `bbdb-cache'.
+
 2011-10-11  Katsumi Yamaoka  <[email protected]>
 
 	* message.el (message-signed-or-encrypted-p): Exclude header when
diff --git a/lisp/spam.el b/lisp/spam.el
index c7f993d..fa152f6 100644
--- a/lisp/spam.el
+++ b/lisp/spam.el
@@ -2150,29 +2150,13 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
 
     (defun spam-check-BBDB ()
       "Mail from people in the BBDB is classified as ham or non-spam"
-      (let ((who (message-fetch-field "from"))
-            bbdb-cache bbdb-hashtable)
-        (when spam-cache-lookups
-          (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches))
-          (unless bbdb-cache
-            (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value
-            ;; this is based on the expanded (bbdb-hashtable) macro
-            ;; without the debugging support
-            (with-current-buffer (bbdb-buffer)
-              (save-excursion
-                (save-window-excursion
-                  (bbdb-records nil t)
-                  (mapatoms
-                   (lambda (symbol)
-                     (intern (downcase (symbol-name symbol)) bbdb-cache))
-                   bbdb-hashtable))))
-            (puthash 'spam-use-BBDB bbdb-cache spam-caches)))
+      (let ((who (message-fetch-field "from")))
         (when who
           (setq who (nth 1 (gnus-extract-address-components who)))
           (if
-              (if spam-cache-lookups
-                  (intern-soft (downcase who) bbdb-cache)
-                (bbdb-search-simple nil who))
+              (if (fboundp 'bbdb-search)
+                  (bbdb-search (bbdb-records) who) ;; v3
+                (bbdb-search-simple nil who)) ;; v2
               t
             (if spam-use-BBDB-exclusive
                 spam-split-group

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    5 +++++
 lisp/spam.el   |   24 ++++--------------------
 2 files changed, 9 insertions(+), 20 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.