FetchBodyPart doesn't need the parent body structure

This commit is contained in:
Reto Brunner 2020-05-17 11:44:38 +02:00
parent bae678e8f2
commit 13a6a3fa71
9 changed files with 24 additions and 29 deletions

View file

@ -138,7 +138,7 @@ func (forward) Execute(aerc *widgets.Aerc, args []string) error {
// TODO: something more intelligent than fetching the 1st part
// TODO: add attachments!
store.FetchBodyPart(msg.Uid, msg.BodyStructure, []int{1}, func(reader io.Reader) {
store.FetchBodyPart(msg.Uid, []int{1}, func(reader io.Reader) {
buf := new(bytes.Buffer)
buf.ReadFrom(reader)
original.Text = buf.String()

View file

@ -127,7 +127,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error {
} else if pipePart {
p := provider.SelectedMessagePart()
store := provider.Store()
store.FetchBodyPart(p.Msg.Uid, p.Msg.BodyStructure, p.Index, func(reader io.Reader) {
store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) {
if background {
doExec(reader)
} else {

View file

@ -114,7 +114,7 @@ func (Recall) Execute(aerc *widgets.Aerc, args []string) error {
path = []int{1}
}
store.FetchBodyPart(msgInfo.Uid, part, path, func(reader io.Reader) {
store.FetchBodyPart(msgInfo.Uid, path, func(reader io.Reader) {
header := message.Header{}
header.SetText(
"Content-Transfer-Encoding", part.Encoding)

View file

@ -165,7 +165,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
template = aerc.Config().Templates.QuotedReply
}
store.FetchBodyPart(msg.Uid, msg.BodyStructure, []int{1}, func(reader io.Reader) {
store.FetchBodyPart(msg.Uid, []int{1}, func(reader io.Reader) {
buf := new(bytes.Buffer)
buf.ReadFrom(reader)
original.Text = buf.String()