diff options
Diffstat (limited to 'commands/msgview/open.go')
-rw-r--r-- | commands/msgview/open.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/commands/msgview/open.go b/commands/msgview/open.go index 82c1accb..bb22026a 100644 --- a/commands/msgview/open.go +++ b/commands/msgview/open.go @@ -48,10 +48,11 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error { mv.MessageView().FetchBodyPart(p.Index, func(reader io.Reader) { extension := "" + mimeType := "" + // try to determine the correct extension based on mimetype if part, err := mv.MessageView().BodyStructure().PartAtIndex(p.Index); err == nil { - mimeType := fmt.Sprintf("%s/%s", part.MIMEType, part.MIMESubType) - + mimeType = fmt.Sprintf("%s/%s", part.MIMEType, part.MIMESubType) if exts, _ := mime.ExtensionsByType(mimeType); len(exts) > 0 { extension = exts[0] } @@ -71,7 +72,8 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error { } go func() { - err = lib.XDGOpen(tmpFile.Name()) + openers := aerc.Config().Openers + err = lib.XDGOpenMime(tmpFile.Name(), mimeType, openers, args[1:]) if err != nil { aerc.PushError("open: " + err.Error()) } |