summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Fleischer <danflscr@gmail.com>2021-08-30 14:42:59 +0300
committerDaniel Fleischer <danflscr@gmail.com>2021-08-30 14:49:07 +0300
commit151a2a323f1ed00217016df2be57d04c67592ce6 (patch)
tree15003eae1979a31a99f2452dc4ad7a4936b8d266
parent4404a5736599e028b3c0b49f371bc6edd5c67bb3 (diff)
Extracting attachments #2116
Different MIME configuration needs a fallback logic. Instead of looking for the attachment "fname" in `("attachment" . (filename "fname"))` structure, we find the same file name in `("mime-type" . (name . "fname"))` structure by searching, since we don't know the MIME type beforehand. Thanks @thierryvolpiatto.
-rw-r--r--mu4e/mu4e-view-gnus.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/mu4e/mu4e-view-gnus.el b/mu4e/mu4e-view-gnus.el
index bd07e61..f703d23 100644
--- a/mu4e/mu4e-view-gnus.el
+++ b/mu4e/mu4e-view-gnus.el
@@ -491,7 +491,10 @@ containing commas."
#'completing-read-multiple))
dir)
(dolist (part parts)
- (let ((fname (cdr (assoc 'filename (assoc "attachment" (cdr part))))))
+ (let ((fname (or (cdr (assoc 'filename (assoc "attachment" (cdr part))))
+ (cl-loop for item in part
+ for name = (and (listp item) (assoc-default 'name item))
+ thereis (and (stringp name) name)))))
(when fname
(push `(,fname . ,(cdr part)) handles)
(push fname files))))