aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg/forward.go
diff options
context:
space:
mode:
authorBen Fiedler <git@services.bfiedler.ch>2020-04-24 22:31:39 +0200
committerDrew DeVault <sir@cmpwn.com>2020-05-01 11:10:08 -0400
commit05fa79eb8efa02e39962c08231ec0e40cafe0020 (patch)
tree90cc60bbc6ec1829021abbb219ba9e49d7b653a2 /commands/msg/forward.go
parentb650bb30a2d3ebd527c66dc7f7b229ca238fe297 (diff)
downloadaerc-05fa79eb8efa02e39962c08231ec0e40cafe0020.tar.gz
store.FetchFull: Change callback type to expose entire message
This is a prerequisite for allowing the FetchFull message to return both the message content and the message headers.
Diffstat (limited to 'commands/msg/forward.go')
-rw-r--r--commands/msg/forward.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/commands/msg/forward.go b/commands/msg/forward.go
index 35a65d8e..0b81e520 100644
--- a/commands/msg/forward.go
+++ b/commands/msg/forward.go
@@ -12,6 +12,8 @@ import (
"git.sr.ht/~sircmpwn/aerc/models"
"git.sr.ht/~sircmpwn/aerc/widgets"
+ "git.sr.ht/~sircmpwn/aerc/worker/types"
+
"git.sr.ht/~sircmpwn/getopt"
)
@@ -109,7 +111,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
}
tmpFileName := path.Join(tmpDir,
strings.ReplaceAll(fmt.Sprintf("%s.eml", msg.Envelope.Subject), "/", "-"))
- store.FetchFull([]uint32{msg.Uid}, func(reader io.Reader) {
+ store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
tmpFile, err := os.Create(tmpFileName)
if err != nil {
println(err)
@@ -119,7 +121,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
}
defer tmpFile.Close()
- io.Copy(tmpFile, reader)
+ io.Copy(tmpFile, fm.Content.Reader)
composer, err := addTab()
if err != nil {
return