From 624fb681a8ceeceecb898627503bf6cf73c2c6e8 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Tue, 4 Jul 2023 12:18:55 +0200 Subject: compose: only allow setting content at creation Add a parameter for the initial value of the body to be inserted *before* the signature when composing a message. Make AppendContents and SetContents private methods to ensure there is no other way to change the composer contents from the outside after creation. Signed-off-by: Robin Jarry Tested-by: Bence Ferdinandy Tested-by: Koni Marti --- commands/account/recover.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'commands/account/recover.go') diff --git a/commands/account/recover.go b/commands/account/recover.go index 350daf17..3e4e9136 100644 --- a/commands/account/recover.go +++ b/commands/account/recover.go @@ -8,7 +8,6 @@ import ( "path/filepath" "git.sr.ht/~rjarry/aerc/commands" - "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/widgets" "git.sr.ht/~sircmpwn/getopt" ) @@ -85,17 +84,11 @@ func (r Recover) Execute(aerc *widgets.Aerc, args []string) error { composer, err := widgets.NewComposer(aerc, acct, acct.AccountConfig(), acct.Worker(), - "", nil, nil) + "", nil, nil, bytes.NewReader(data)) if err != nil { return err } - composer.Tab = aerc.NewTab(composer, "Recovered") - go func() { - defer log.PanicHandler() - - composer.AppendContents(bytes.NewReader(data)) - }() // remove file if force flag is set if force { -- cgit