]> git.eshelyaron.com Git - emacs.git/commitdiff
Make mml respect the "recipient-filename" parameter
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 May 2019 20:16:10 +0000 (16:16 -0400)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 13 May 2019 20:16:10 +0000 (16:16 -0400)
* lisp/gnus/mml.el (mml-insert-mime-headers): Implement the
already-documented "recipient-filename" parameter (bug#34654).

lisp/gnus/mml.el

index 7a99a0dc46c521e98276dd5070f1728a7b35114c..b0b4fd0a54df0371609e203c9471ad6f1f4c109d 100644 (file)
@@ -906,8 +906,14 @@ be \"related\" or \"alternate\"."
              (or disposition
                  (mml-content-disposition type (cdr (assq 'filename cont)))))
       (when parameters
-       (mml-insert-parameter-string
-        cont mml-content-disposition-parameters))
+       (let ((cont (copy-sequence cont)))
+         ;; Set the file name to what's specified by the user.
+         (when-let ((recipient-filename (cdr (assq 'recipient-filename cont))))
+           (setcdr cont
+                   (cons (cons 'filename recipient-filename)
+                         (cdr cont))))
+         (mml-insert-parameter-string
+          cont mml-content-disposition-parameters)))
       (insert "\n"))
     (unless (eq encoding '7bit)
       (insert (format "Content-Transfer-Encoding: %s\n" encoding)))