aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview/save.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msgview/save.go')
-rw-r--r--commands/msgview/save.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/commands/msgview/save.go b/commands/msgview/save.go
index 993f4278..4820ec0f 100644
--- a/commands/msgview/save.go
+++ b/commands/msgview/save.go
@@ -215,12 +215,7 @@ func isAbsPath(path string) bool {
// generateFilename tries to get the filename from the given part.
// if that fails it will fallback to a generated one based on the date
func generateFilename(part *models.BodyStructure) string {
- var filename string
- if fn, ok := part.DispositionParams["filename"]; ok {
- filename = fn
- } else if fn, ok := part.Params["name"]; ok {
- filename = fn
- }
+ filename := part.FileName()
// Some MUAs send attachments with names like /some/stupid/idea/happy.jpeg
// Assuming non hostile intent it does make sense to use just the last
// portion of the pathname as the filename for saving it.