Synch to No Gnus 200405061334.
authoryamaoka <yamaoka>
Thu, 6 May 2004 14:54:55 +0000 (14:54 +0000)
committeryamaoka <yamaoka>
Thu, 6 May 2004 14:54:55 +0000 (14:54 +0000)
lisp/ChangeLog
lisp/gnus-art.el

index b8d51e4..e758535 100644 (file)
@@ -1,7 +1,7 @@
 2004-05-06  TSUCHIYA Masatoshi  <tsuchiya@namazu.org>
 
-       * gnus-art.el (article-strip-banner): Use original from fields
-       instead of MIME-decoded from fields, when checking
+       * gnus-art.el (article-strip-banner): Use MIME-encoded from fields
+       instead of MIME-decoded from fields when checking
        `gnus-article-address-banner-alist'.
 
 2004-05-03  Jesper Harder  <harder@ifa.au.dk>
index b3f65a2..b92c81f 100644 (file)
@@ -2624,9 +2624,20 @@ always hide."
          (article-really-strip-banner
           (gnus-parameter-banner gnus-newsgroup-name)))
        (when gnus-article-address-banner-alist
-         (let ((from (caar (mail-header-parse-addresses
-                            (gnus-fetch-original-field "from")))))
-           (when from
+         ;; 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.
+         (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)))))
              (catch 'found
                (dolist (pair gnus-article-address-banner-alist)
                  (when (string-match (car pair) from)