aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/reply.go
diff options
context:
space:
mode:
authorLeszek CimaƂa <ernierasta@zori.cz>2020-01-08 21:44:14 +0100
committerDrew DeVault <sir@cmpwn.com>2020-01-09 14:31:19 -0500
commitbf28e23933a9808820ef4855257accf4634068e9 (patch)
treed09d522d0f48d6f3e1013f5f7197e64636e51e99 /commands/msg/reply.go
parentda6fb1a1551767609e1d5a97631bdaffdc301f4c (diff)
downloadaerc-bf28e23933a9808820ef4855257accf4634068e9.tar.gz
create OriginalMail struct
Diffstat (limited to 'commands/msg/reply.go')
-rw-r--r--commands/msg/reply.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index a7379d75..2964a83e 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -116,15 +116,16 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
"Subject": subject,
"In-Reply-To": msg.Envelope.MessageId,
}
+ original := models.OriginalMail{}
addTab := func() error {
if template != "" {
- defaults["OriginalFrom"] = models.FormatAddresses(msg.Envelope.From)
- defaults["OriginalDate"] = msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM")
+ original.From = models.FormatAddresses(msg.Envelope.From)
+ original.Date = msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM")
}
composer, err := widgets.NewComposer(aerc, aerc.Config(),
- acct.AccountConfig(), acct.Worker(), template, defaults)
+ acct.AccountConfig(), acct.Worker(), template, defaults, original)
if err != nil {
aerc.PushError("Error: " + err.Error())
return err
@@ -155,7 +156,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
store.FetchBodyPart(msg.Uid, msg.BodyStructure, []int{1}, func(reader io.Reader) {
buf := new(bytes.Buffer)
buf.ReadFrom(reader)
- defaults["Original"] = buf.String()
+ original.Text = buf.String()
addTab()
})
return nil