mu4e-view: port of save-attachment fix

Port of #b349b24 (courtesy of danielfleischer) to not fail to detect attachments
in certain messages.
This commit is contained in:
Dirk-Jan C. Binnema 2021-08-30 18:35:35 +03:00
parent 128bc731a6
commit 162f5896ae
1 changed files with 4 additions and 1 deletions

View File

@ -1045,7 +1045,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))))