diff options
author | Reto Brunner <reto@labrat.space> | 2020-11-03 07:39:36 +0100 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-11-14 15:40:13 +0100 |
commit | 3ad3a5ede07c1248ae8176bdc19a623731c64056 (patch) | |
tree | 08a847d6f398c09f789dd0a9b587c21ada8f8c17 | |
parent | e7d450c61df85b16917444fc2c6ea6c11e3c5b44 (diff) | |
download | aerc-3ad3a5ede07c1248ae8176bdc19a623731c64056.tar.gz |
models: add RFC822 headers to OriginalMail
-rw-r--r-- | commands/msg/forward.go | 11 | ||||
-rw-r--r-- | commands/msg/reply.go | 11 | ||||
-rw-r--r-- | models/models.go | 9 |
3 files changed, 15 insertions, 16 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go index 0c6b0e05..b17482f9 100644 --- a/commands/msg/forward.go +++ b/commands/msg/forward.go @@ -74,14 +74,13 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error { "To": to, "Subject": subject, } - original := models.OriginalMail{} + original := models.OriginalMail{ + From: format.FormatAddresses(msg.Envelope.From), + Date: msg.Envelope.Date, + RFC822Headers: msg.RFC822Headers, + } addTab := func() (*widgets.Composer, error) { - if template != "" { - original.From = format.FormatAddresses(msg.Envelope.From) - original.Date = msg.Envelope.Date - } - composer, err := widgets.NewComposer(aerc, acct, aerc.Config(), acct.AccountConfig(), acct.Worker(), template, defaults, original) if err != nil { diff --git a/commands/msg/reply.go b/commands/msg/reply.go index 85039793..0298ac20 100644 --- a/commands/msg/reply.go +++ b/commands/msg/reply.go @@ -152,14 +152,13 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error { "Subject": subject, "In-Reply-To": msg.Envelope.MessageId, } - original := models.OriginalMail{} + original := models.OriginalMail{ + From: format.FormatAddresses(msg.Envelope.From), + Date: msg.Envelope.Date, + RFC822Headers: msg.RFC822Headers, + } addTab := func() error { - if template != "" { - original.From = format.FormatAddresses(msg.Envelope.From) - original.Date = msg.Envelope.Date - } - composer, err := widgets.NewComposer(aerc, acct, aerc.Config(), acct.AccountConfig(), acct.Worker(), template, defaults, original) if err != nil { diff --git a/models/models.go b/models/models.go index bfe0ff3a..45f3b9de 100644 --- a/models/models.go +++ b/models/models.go @@ -134,8 +134,9 @@ type Envelope struct { // OriginalMail is helper struct used for reply/forward type OriginalMail struct { - Date time.Time - From string - Text string - MIMEType string + Date time.Time + From string + Text string + MIMEType string + RFC822Headers *mail.Header } |