Remove hard coded bodystruct path everywhere

Aerc usually used the path []int{1} if it didn't know what the proper path is.
However this only works for multipart messages and breaks if it isn't one.

This patch removes all the hard coding and extracts the necessary helpers to lib.
This commit is contained in:
Reto Brunner 2020-06-19 17:58:08 +02:00
parent 494bd674a9
commit c574a838fa
8 changed files with 62 additions and 54 deletions

View file

@ -180,7 +180,7 @@ func createSwitcher(acct *AccountView, switcher *PartSwitcher,
if len(msg.BodyStructure().Parts) == 0 {
switcher.selected = 0
pv, err := NewPartViewer(acct, conf, msg, msg.BodyStructure(), []int{1})
pv, err := NewPartViewer(acct, conf, msg, msg.BodyStructure(), nil)
if err != nil {
return err
}