aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/forward.go6
-rw-r--r--commands/msg/pipe.go7
2 files changed, 8 insertions, 5 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
diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go
index 9fbc3acc..44b0067d 100644
--- a/commands/msg/pipe.go
+++ b/commands/msg/pipe.go
@@ -9,6 +9,7 @@ import (
"git.sr.ht/~sircmpwn/aerc/commands"
"git.sr.ht/~sircmpwn/aerc/widgets"
+ "git.sr.ht/~sircmpwn/aerc/worker/types"
"git.sr.ht/~sircmpwn/getopt"
"github.com/gdamore/tcell"
@@ -115,11 +116,11 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
if err != nil {
return err
}
- store.FetchFull([]uint32{msg.Uid}, func(reader io.Reader) {
+ store.FetchFull([]uint32{msg.Uid}, func(fm *types.FullMessage) {
if background {
- doExec(reader)
+ doExec(fm.Content.Reader)
} else {
- doTerm(reader, fmt.Sprintf(
+ doTerm(fm.Content.Reader, fmt.Sprintf(
"%s <%s", cmd[0], msg.Envelope.Subject))
}
})