NOTE: This patch has been committed. The version below is
informational only (whitespace differences have been removed).

                Dear Big Brothers,


        as of 04/04/2007, I've extended the type of
gnus-ignored-from-addresses to a list of regexps. The following patch
makes BBDB aware of that.


ChangeLog addition:

2008-01-29  Didier Verna  <[EMAIL PROTECTED]>

        Handle recent type change of gnus-ignored-from-addresses.
        * lisp/bbdb-gnus.el (bbdb/gnus-ignored-from-addresses): New.
        * lisp/bbdb-gnus.el (bbdb/gnus-update-records): Use it.
        * lisp/bbdb-gnus.el (bbdb/gnus-summary-get-author): Ditto.


BBDB source patch:
Diff command:   cvs -q diff -u -t -b -B -w
Files affected: lisp/bbdb-gnus.el
===================================================================
RCS

Index: lisp/bbdb-gnus.el
===================================================================
RCS file: /cvsroot/bbdb/bbdb/lisp/bbdb-gnus.el,v
retrieving revision 1.102
diff -u -u -t -b -B -w -r1.102 bbdb-gnus.el
--- lisp/bbdb-gnus.el   4 Dec 2007 23:24:53 -0000       1.102
+++ lisp/bbdb-gnus.el   29 Jan 2008 14:48:05 -0000
@@ -40,6 +40,15 @@
    (defvar gnus-optional-headers)
    (defvar gnus-summary-to-prefix))
 
+(defsubst bbdb/gnus-ignored-from-addresses ()
+  "Return the value of `gnus-ignored-from-addresses' handling both
+recent Gnus (>= 04/2007) and older ones."
+  (cond ((fboundp 'gnus-ignored-from-addresses)
+         (gnus-ignored-from-addresses))
+        ((boundp 'gnus-ignored-from-addresses)
+         gnus-ignored-from-addresses)
+        (t nil)))
+
 (defun bbdb/gnus-get-message-id ()
   "Return the message-id of the current message."
   (save-excursion
@@ -119,8 +128,7 @@
           (setq records (bbdb-update-records
                          (bbdb-get-addresses
                           bbdb-get-only-first-address-p
-                          (or (if (boundp 'gnus-ignored-from-addresses)
-                                  gnus-ignored-from-addresses)
+                          (or (bbdb/gnus-ignored-from-addresses)
                               bbdb-user-mail-names)
                           'gnus-fetch-field)
                          bbdb/news-auto-create-p
@@ -328,15 +336,14 @@
 This function is meant to be used with the user function defined in
   `bbdb/gnus-summary-user-format-letter'"
   (let* ((from (mail-header-from header))
-         (to (when (and (boundp 'gnus-ignored-from-addresses)
-                        gnus-ignored-from-addresses
-                        (string-match gnus-ignored-from-addresses from))
+         (to (let ((gifa (bbdb/gnus-ignored-from-addresses)))
+               (when (and gifa (string-match gifa from))
                (let* ((to (or (mail-header 'To)
                               (mail-header 'CC)
                               (mail-header 'Newsgroups))))
                  (if (and to (listp to))
                      (cdr (car to))
-                   to))))
+                     to)))))
          (data (and bbdb/gnus-summary-show-bbdb-names
                     (condition-case nil
                         (mail-extract-address-components (or to from))

-- 
Resistance is futile. You will be jazzimilated.

Didier Verna, [EMAIL PROTECTED], http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire   Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-BicĂȘtre, France   Fax.+33 (0)1 53 14 59 22  [EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Reply via email to