(require 'rfc822)
(eval-and-compile
+ (autoload 'customize-save-variable "cus-edit") ;; for Mule 2.
(autoload 'sha1 "sha1-el")
(autoload 'gnus-find-method-for-group "gnus")
(autoload 'nnvirtual-find-group-art "nnvirtual")
- (autoload 'customize-save-variable "cus-edit")) ;; for Mule 2.
+ (autoload 'gnus-group-decoded-name "gnus-group"))
(defgroup message '((user-mail-address custom-variable)
(user-full-name custom-variable))
(defvar message-forward-decoded-p nil
"Non-nil means the original message is decoded.")
-(defun message-forward-subject-author-subject (subject)
+(defun message-forward-subject-name-subject (subject)
"Generate a SUBJECT for a forwarded message.
The form is: [Source] Subject, where if the original message was mail,
-Source is the sender, and if the original message was news, Source is
-the list of newsgroups is was posted to."
+Source is the name of the sender, and if the original message was
+news, Source is the list of newsgroups is was posted to."
(concat "["
- (let ((prefix (message-fetch-field "newsgroups")))
- (or prefix
- (and (setq prefix (message-fetch-field "from"))
- (nnheader-decode-from prefix))
- "(nowhere)"))
+ (let ((group (message-fetch-field "newsgroups"))
+ from)
+ (if group
+ (gnus-group-decoded-name group)
+ (if (setq from (message-fetch-field "from"))
+ (std11-extract-address-components (nnheader-decode-from
+ from))
+ "(nowhere)")))
"] " subject))
-(defun message-forward-subject-name-subject (subject)
+(defun message-forward-subject-author-subject (subject)
"Generate a SUBJECT for a forwarded message.
The form is: [Source] Subject, where if the original message was mail,
-Source is the name of the sender, and if the original message was
-news, Source is the list of newsgroups is was posted to."
+Source is the sender, and if the original message was news, Source is
+the list of newsgroups is was posted to."
(concat "["
- (let ((prefix (message-fetch-field "newsgroups")))
- (or prefix
- (and (setq prefix (message-fetch-field "from"))
- (car (std11-extract-address-components
- (nnheader-decode-from prefix))))
- "(nowhere)"))
+ (let ((group (message-fetch-field "newsgroups"))
+ from)
+ (if group
+ (gnus-group-decoded-name group)
+ (if (setq from (message-fetch-field "from"))
+ (nnheader-decode-from from)
+ "(nowhere)")))
"] " subject))
(defun message-forward-subject-fwd (subject)