From bf28e23933a9808820ef4855257accf4634068e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leszek=20Cima=C5=82a?= Date: Wed, 8 Jan 2020 21:44:14 +0100 Subject: create OriginalMail struct --- widgets/aerc.go | 3 ++- widgets/compose.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'widgets') diff --git a/widgets/aerc.go b/widgets/aerc.go index da3f56f..a0e356a 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -14,6 +14,7 @@ import ( "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib" "git.sr.ht/~sircmpwn/aerc/lib/ui" + "git.sr.ht/~sircmpwn/aerc/models" ) type Aerc struct { @@ -432,7 +433,7 @@ func (aerc *Aerc) Mailto(addr *url.URL) error { } } composer, err := NewComposer(aerc, aerc.Config(), - acct.AccountConfig(), acct.Worker(), "", defaults) + acct.AccountConfig(), acct.Worker(), "", defaults, models.OriginalMail{}) if err != nil { return nil } diff --git a/widgets/compose.go b/widgets/compose.go index 091eb70..636dcd1 100644 --- a/widgets/compose.go +++ b/widgets/compose.go @@ -26,6 +26,7 @@ import ( "git.sr.ht/~sircmpwn/aerc/config" "git.sr.ht/~sircmpwn/aerc/lib/templates" "git.sr.ht/~sircmpwn/aerc/lib/ui" + "git.sr.ht/~sircmpwn/aerc/models" "git.sr.ht/~sircmpwn/aerc/worker/types" ) @@ -59,7 +60,7 @@ type Composer struct { func NewComposer(aerc *Aerc, conf *config.AercConfig, acct *config.AccountConfig, worker *types.Worker, template string, - defaults map[string]string) (*Composer, error) { + defaults map[string]string, original models.OriginalMail) (*Composer, error) { if defaults == nil { defaults = make(map[string]string) @@ -68,7 +69,7 @@ func NewComposer(aerc *Aerc, conf *config.AercConfig, defaults["From"] = acct.From } - templateData := templates.ParseTemplateData(defaults) + templateData := templates.ParseTemplateData(defaults, original) cmpl := completer.New(conf.Compose.AddressBookCmd, func(err error) { aerc.PushError(fmt.Sprintf("could not complete header: %v", err)) worker.Logger.Printf("could not complete header: %v", err) -- cgit v1.2.3