* wl-draft.el (wl-draft-insert-ccs): New function.
authorokada <okada>
Sat, 17 Feb 2001 04:04:17 +0000 (04:04 +0000)
committerokada <okada>
Sat, 17 Feb 2001 04:04:17 +0000 (04:04 +0000)
(wl-draft): Use `wl-draft-insert-ccs' for Bcc and FCC.
* wl-vars.el (wl-draft-delete-myself-from-bcc-fcc): New variable.

doc/wl-ja.texi
doc/wl.texi
wl/ChangeLog
wl/wl-draft.el
wl/wl-vars.el

index 338c30e..e979db5 100644 (file)
@@ -4234,6 +4234,11 @@ Non-nil \e$B$J$i<+F0E*$KAw?.$7$^$9\e(B (\e$B$$$A$*$&\e(B @code{y-or-n-p} \e$B$G3NG'$7
 Non-nil \e$B$J$i!"<+J,08$F$N%a!<%k$KJV?.$9$k>l9g!">o$K\e(B @samp{To:},
 @samp{Cc:} \e$B$+$i<+J,$N%a!<%k%"%I%l%9$r:o=|$7$^$9!#\e(B
 
+@item wl-draft-delete-myself-from-bcc-fcc
+@vindex wl-draft-delete-myself-from-bcc-fcc
+Non-nil \e$B$G!"\e(B@samp{To:}, @samp{Cc:} \e$B$,\e(B \e$BJQ?t\e(B @code{wl-subscribed-mailing-list} \e$B$K\e(B
+\e$B4^$^$l$F$$$k>l9g!"\e(B@samp{Bcc:} , @samp{FCC:} \e$B$r$D$1$^$;$s!%\e(B
+
 @item wl-smtp-posting-server
 @vindex wl-smtp-posting-server
 \e$B=i4|@_Dj$O\e(B @code{nil}\e$B!#\e(B
index 8597c97..a6d72da 100644 (file)
@@ -4267,6 +4267,11 @@ All headers that match this regexp will be deleted when resending a message.
 If non-nil, always removes your own address from @samp{To:} and
 @samp{Cc:} when you are replying to the mail addressed to you.
 
+@item wl-draft-delete-myself-from-bcc-fcc
+@vindex wl-draft-delete-myself-from-bcc-fcc
+If any of @code{wl-subscribed-mailing-list} are contained in @samp{To:}
+or @samp{Cc:} field, do not insert @samp{Bcc:} or @samp{FCC:} field.
+
 @item wl-smtp-posting-server
 @vindex wl-smtp-posting-server
 The initial setting is @code{nil}.
index 97a8528..9f520eb 100644 (file)
@@ -1,3 +1,9 @@
+2001-02-17  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl-draft.el (wl-draft-insert-ccs): New function.
+       (wl-draft): Use `wl-draft-insert-ccs' for Bcc and FCC.
+       * wl-vars.el (wl-draft-delete-myself-from-bcc-fcc): New variable.
+
 2001-02-15  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * wl-summary.el (wl-cache-prefetch-message): Fixed last change.
index e82c707..e2204bd 100644 (file)
@@ -1338,10 +1338,9 @@ If optional argument is non-nil, current draft buffer is killed"
     (setq wl-draft-buffer-file-name file-name)
     (if mail-default-reply-to
        (insert "Reply-To: " mail-default-reply-to "\n"))
-    (if (or wl-bcc mail-self-blind)
-       (insert "Bcc: " (or wl-bcc (user-login-name)) "\n"))
-    (if wl-fcc
-       (insert "FCC: " (if (functionp wl-fcc) (funcall wl-fcc) wl-fcc) "\n"))
+    (wl-draft-insert-ccs "Bcc: " (or wl-bcc
+                              (and mail-self-blind (user-login-name))))
+    (wl-draft-insert-ccs "FCC: " wl-fcc)
     (if wl-organization
        (insert "Organization: " wl-organization "\n"))
     (and wl-auto-insert-x-face
@@ -1357,7 +1356,7 @@ If optional argument is non-nil, current draft buffer is killed"
          (when content-type
            (insert "Content-type: " content-type "\n"))
          (when content-transfer-encoding
-           (insert "Content-Transfer-encoding: " content-transfer-encoding "\n"))
+           (insert "Content-Transfer-Encoding: " content-transfer-encoding "\n"))
          (if (or content-type content-transfer-encoding)
              (insert "\n"))
          (and body (insert body))
@@ -1403,6 +1402,21 @@ If optional argument is non-nil, current draft buffer is killed"
                                                  wl-summary-buffer-name)))
     buf-name))
 
+(defsubst wl-draft-insert-ccs (str cc)
+  (let ((field
+        (if (functionp cc)
+            (funcall cc)
+          cc)))
+    (if (and field
+            (null (and wl-draft-delete-myself-from-bcc-fcc
+                       (elmo-list-member
+                        (mapcar 'wl-address-header-extract-address
+                                (append
+                                 (wl-parse-addresses (std11-field-body "To"))
+                                 (wl-parse-addresses (std11-field-body "Cc"))))
+                        (mapcar 'downcase wl-subscribed-mailing-list)))))
+       (insert str field "\n"))))
+
 (defun wl-draft-elmo-nntp-send ()
   (let ((elmo-nntp-post-pre-hook wl-news-send-pre-hook)
        (elmo-default-nntp-user
index 2a37db4..b62a263 100644 (file)
@@ -607,6 +607,12 @@ Default is for 'followup-to-me'."
   :type 'boolean
   :group 'wl-draft)
 
+(defcustom wl-draft-delete-myself-from-bcc-fcc nil
+  "*Do not insert bcc or fcc if To and Cc fields is a member of
+`wl-subscribed-mailing-list'"
+  :type 'boolean
+  :group 'wl-draft)
+
 (defcustom wl-draft-resume-folder-window t
   "*Resume folder window in `wl-draft-hide'."
   :type 'boolean