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
This commit is contained in:
Reto Brunner 2020-01-04 21:13:51 +01:00 committed by Drew DeVault
parent 19dfc49481
commit 9096049f75
8 changed files with 29 additions and 117 deletions
commands/msgview

View file

@ -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") {

View file

@ -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") {