* wl-summary.el (wl-summary-resend-message): Fixed.
authorteranisi <teranisi>
Wed, 13 Jun 2001 08:40:01 +0000 (08:40 +0000)
committerteranisi <teranisi>
Wed, 13 Jun 2001 08:40:01 +0000 (08:40 +0000)
* wl-draft.el (wl-draft-edit-string): Fetch From: field value and
Call wl-draft with `from' argument if its address is included in
`wl-user-mail-address-list'.
(wl-draft): Added `from' argument.

wl/ChangeLog
wl/wl-draft.el
wl/wl-summary.el

index 070d728..b297588 100644 (file)
@@ -1,5 +1,12 @@
 2001-06-13  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl-summary.el (wl-summary-resend-message): Fixed.
+
+       * wl-draft.el (wl-draft-edit-string): Fetch From: field value and
+       Call wl-draft with `from' argument if its address is included in
+       `wl-user-mail-address-list'.
+       (wl-draft): Added `from' argument.
+
        * wl.el (wl-exit): Delete current frame if wl-folder-use-frame is
        non-nil.
        (wl): Don't show demo if wl-demo is nil.
index c49af3a..7a3f01a 100644 (file)
@@ -489,9 +489,8 @@ Reply to author if WITH-ARG is non-nil."
   (let ((cur-buf (current-buffer))
        (tmp-buf (get-buffer-create " *wl-draft-edit-string*"))
        to subject in-reply-to cc references newsgroups mail-followup-to
-       content-type content-transfer-encoding
-       body-beg buffer-read-only
-       )
+       content-type content-transfer-encoding from
+       body-beg buffer-read-only)
     (set-buffer tmp-buf)
     (erase-buffer)
     (insert string)
@@ -507,6 +506,12 @@ Reply to author if WITH-ARG is non-nil."
                        (decode-mime-charset-string
                         subject
                         wl-mime-charset))))
+    (setq from (std11-field-body "From")
+         from (and from
+                   (eword-decode-string
+                    (decode-mime-charset-string
+                     from
+                     wl-mime-charset))))
     (setq in-reply-to (std11-field-body "In-Reply-To"))
     (setq cc (std11-field-body "Cc"))
     (setq cc (and cc
@@ -528,8 +533,10 @@ Reply to author if WITH-ARG is non-nil."
                   mail-followup-to
                   content-type content-transfer-encoding
                   (buffer-substring (point) (point-max))
-                  'edit-again
-                  ))
+                  'edit-again nil
+                  (if (member (nth 1 (std11-extract-address-components from))
+                              wl-user-mail-address-list)
+                      from)))
       (and to (mail-position-on-field "To"))
       (delete-other-windows)
       (kill-buffer tmp-buf)))
@@ -1284,7 +1291,7 @@ If optional argument is non-nil, current draft buffer is killed"
 (defun wl-draft (&optional to subject in-reply-to cc references newsgroups
                           mail-followup-to
                           content-type content-transfer-encoding
-                          body edit-again summary-buf)
+                          body edit-again summary-buf from)
   "Write and send mail/news message with Wanderlust."
   (interactive)
   (unless (featurep 'wl)
@@ -1324,8 +1331,8 @@ If optional argument is non-nil, current draft buffer is killed"
     (auto-save-mode -1)
     (wl-draft-mode)
     (setq wl-sent-message-via nil)
-    (if (stringp wl-from)
-       (insert "From: " wl-from "\n"))
+    (if (stringp (or from wl-from))
+       (insert "From: " (or from wl-from) "\n"))
     (and (or (interactive-p)
             (eq this-command 'wl-summary-write)
             to)
index a6cb532..33e8a46 100644 (file)
@@ -643,8 +643,7 @@ you."
       (message "No address specified.")
     (message "Resending message to %s..." address)
     (save-excursion
-      (let ((mmelmo-force-fetch-entire-message t))
-       (wl-summary-set-message-buffer-or-redisplay)
+      (let ((original (wl-summary-get-original-buffer)))
        ;; We first set up a normal mail buffer.
        (set-buffer (get-buffer-create " *wl-draft-resend*"))
        (buffer-disable-undo (current-buffer))
@@ -664,7 +663,7 @@ you."
        (delete-region (point) (point-max))
        (let ((beg  (point)))
          ;; Insert the message to be resent.
-         (insert-buffer-substring (wl-message-get-original-buffer))
+         (insert-buffer-substring original)
          (goto-char (point-min))
          (search-forward "\n\n")
          (forward-char -1)