From 9096049f757ca0a43ac5cbad7eb27db8c1897d91 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Sat, 4 Jan 2020 21:13:51 +0100 Subject: FetchBodyParts: decode source in the workers Previously the workers returned a mixture of decoded / encoded parts. This lead to a whole bunch of issues. This commit changes the msgviewer and the commands to assume parts to already be decoded --- commands/msgview/open.go | 2 +- commands/msgview/save.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'commands/msgview') diff --git a/commands/msgview/open.go b/commands/msgview/open.go index ab023a1..6001d28 100644 --- a/commands/msgview/open.go +++ b/commands/msgview/open.go @@ -36,7 +36,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error { mv := aerc.SelectedTab().(*widgets.MessageViewer) p := mv.SelectedMessagePart() - p.Store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) { + p.Store.FetchBodyPart(p.Msg.Uid, p.Msg.BodyStructure, p.Index, func(reader io.Reader) { // email parts are encoded as 7bit (plaintext), quoted-printable, or base64 if strings.EqualFold(p.Part.Encoding, "base64") { diff --git a/commands/msgview/save.go b/commands/msgview/save.go index 99abe0e..c017e70 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -60,7 +60,7 @@ func (Save) Execute(aerc *widgets.Aerc, args []string) error { mv := aerc.SelectedTab().(*widgets.MessageViewer) p := mv.SelectedMessagePart() - p.Store.FetchBodyPart(p.Msg.Uid, p.Index, func(reader io.Reader) { + p.Store.FetchBodyPart(p.Msg.Uid, p.Msg.BodyStructure, p.Index, func(reader io.Reader) { // email parts are encoded as 7bit (plaintext), quoted-printable, or base64 if strings.EqualFold(p.Part.Encoding, "base64") { -- cgit 1.4.1-2-gfad0