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.
This commit is contained in:
Ben Fiedler 2020-04-24 22:31:39 +02:00 committed by Drew DeVault
parent b650bb30a2
commit 05fa79eb8e
5 changed files with 17 additions and 11 deletions
commands/msg

View file

@ -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))
}
})