diff options
-rw-r--r-- | commands/msgview/save.go | 2 | ||||
-rw-r--r-- | widgets/msgviewer.go | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/commands/msgview/save.go b/commands/msgview/save.go index 33cd45f7..99abe0e2 100644 --- a/commands/msgview/save.go +++ b/commands/msgview/save.go @@ -94,6 +94,8 @@ func (Save) Execute(aerc *widgets.Aerc, args []string) error { save_dir = path if filename, ok := p.Part.DispositionParams["filename"]; ok { save_file = filename + } else if filename, ok := p.Part.Params["name"]; ok { + save_file = filename } else { timestamp := time.Now().Format("2006-01-02-150405") save_file = fmt.Sprintf("aerc_%v", timestamp) diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go index 9d71c3e2..6de729e9 100644 --- a/widgets/msgviewer.go +++ b/widgets/msgviewer.go @@ -319,6 +319,9 @@ func (ps *PartSwitcher) Draw(ctx *ui.Context) { strings.ToLower(part.part.MIMESubType)) if filename, ok := part.part.DispositionParams["filename"]; ok { name += fmt.Sprintf(" (%s)", filename) + } else if filename, ok := part.part.Params["name"]; ok { + // workaround golang not supporting RFC2231 besides ASCII and UTF8 + name += fmt.Sprintf(" (%s)", filename) } ctx.Printf(len(part.index)*2, y+i, style, "%s", name) } |