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 /widgets/aerc.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 'widgets/aerc.go')
-rw-r--r-- | widgets/aerc.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go index 85ce686b..8f744b4c 100644 --- a/widgets/aerc.go +++ b/widgets/aerc.go @@ -734,11 +734,11 @@ func (aerc *Aerc) Mailto(addr *url.URL) error { defer ui.Invalidate() composer, err := NewComposer(aerc, acct, - acct.AccountConfig(), acct.Worker(), template, h, nil) + acct.AccountConfig(), acct.Worker(), template, h, nil, + strings.NewReader(body)) if err != nil { return err } - composer.SetContents(strings.NewReader(body)) composer.FocusEditor("subject") title := "New email" if subject != "" { |