summaryrefslogtreecommitdiff
path: root/commands/msg/recall.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-11-10 20:27:30 +0100
committerReto Brunner <reto@labrat.space>2020-11-14 15:40:13 +0100
commit20ec2c8eeb2e071f28358814935a0f56672a9f49 (patch)
tree501b43a39a4152872bb6f08221da9c37fc75559c /commands/msg/recall.go
parent3ad3a5ede07c1248ae8176bdc19a623731c64056 (diff)
downloadaerc-20ec2c8eeb2e071f28358814935a0f56672a9f49.zip
compose: use a proper header instead of a string map
Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
Diffstat (limited to 'commands/msg/recall.go')
-rw-r--r--commands/msg/recall.go10
1 files changed, 2 insertions, 8 deletions
diff --git a/commands/msg/recall.go b/commands/msg/recall.go
index 5212041..b6c7f65 100644
--- a/commands/msg/recall.go
+++ b/commands/msg/recall.go
@@ -53,15 +53,9 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
}
acct.Logger().Println("Recalling message " + msgInfo.Envelope.MessageId)
- // copy the headers to the defaults map for addition to the composition
- defaults := make(map[string]string)
- headerFields := msgInfo.RFC822Headers.Fields()
- for headerFields.Next() {
- defaults[headerFields.Key()] = headerFields.Value()
- }
-
composer, err := widgets.NewComposer(aerc, acct, aerc.Config(),
- acct.AccountConfig(), acct.Worker(), "", defaults, models.OriginalMail{})
+ acct.AccountConfig(), acct.Worker(), "", msgInfo.RFC822Headers,
+ models.OriginalMail{})
if err != nil {
return errors.Wrap(err, "Cannot open a new composer")
}