mirror of
https://git.sr.ht/~sircmpwn/aerc
synced 2024-11-22 16:11:58 +01:00
models: add RFC822 headers to OriginalMail
This commit is contained in:
parent
e7d450c61d
commit
3ad3a5ede0
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user