(article-strip-banner): Use gnus-extract-address-components instead of
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 16 Feb 2006 11:52:42 +0000 (11:52 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 16 Feb 2006 11:52:42 +0000 (11:52 +0000)
 mail-header-parse-addresses to make it work with non-ASCII text;
 remove mail-encode-encoded-word-string.

lisp/ChangeLog
lisp/gnus-art.el

index 9be107b..6c6202a 100644 (file)
@@ -1,5 +1,10 @@
 2006-02-16  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * gnus-art.el (article-strip-banner): Use
+       gnus-extract-address-components instead of
+       mail-header-parse-addresses to make it work with non-ASCII text;
+       remove mail-encode-encoded-word-string.
+
        * rfc2231.el (rfc2231-parse-string): Attempt to parse parameter
        values which are surrounded with \"...\"; make it never cause a
        Lisp error; give up parsing of parameters if it failed in
index 9539348..ac4d64e 100644 (file)
@@ -2704,20 +2704,17 @@ always hide."
          (article-really-strip-banner
           (gnus-parameter-banner gnus-newsgroup-name)))
        (when gnus-article-address-banner-alist
-         ;; It is necessary to encode from fields before checking,
-         ;; because `mail-header-parse-addresses' does not work
-         ;; (reliably) on decoded headers.  And more, it is
-         ;; impossible to use `gnus-fetch-original-field' here,
-         ;; because `article-strip-banner' may be called in draft
-         ;; buffers to preview them.
+         ;; Note that the From header is decoded here, so it is
+         ;; required that the *-extract-address-components function
+         ;; supports non-ASCII text.
          (let ((from (save-restriction
                        (widen)
                        (article-narrow-to-head)
                        (mail-fetch-field "from"))))
            (when (and from
                       (setq from
-                            (caar (mail-header-parse-addresses
-                                   (mail-encode-encoded-word-string from)))))
+                            (cadr (funcall gnus-extract-address-components
+                                           from))))
              (catch 'found
                (dolist (pair gnus-article-address-banner-alist)
                  (when (string-match (car pair) from)