diff options
author | Robin Jarry <robin@jarry.cc> | 2023-07-04 12:18:55 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-07-17 10:23:36 +0200 |
commit | 624fb681a8ceeceecb898627503bf6cf73c2c6e8 (patch) | |
tree | 68cc73e04e0c2100795b9bfb0720bbc8f28f431f /commands/account/recover.go | |
parent | 21f14c550a44a4b9207ca27b81976f92a7d26784 (diff) | |
download | aerc-624fb681a8ceeceecb898627503bf6cf73c2c6e8.tar.gz |
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 <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'commands/account/recover.go')
-rw-r--r-- | commands/account/recover.go | 9 |
1 files changed, 1 insertions, 8 deletions
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 { |