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:
parent
494bd674a9
commit
c574a838fa
8 changed files with 62 additions and 54 deletions
widgets
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue