diff lisp/gnus/mm-decode.el @ 60302:f34a552e4a9f

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-139 Merge from gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2005/gnus--rel--5.10 (patch 32-33) - Merge from emacs--cvs-trunk--0 - Update from CVS 2005-02-27 Arne J,Ax(Brgensen <arne@arnested.dk> * lisp/gnus/mm-decode.el (mm-dissect-buffer): Pass the from field on to `mm-dissect-multipart' and receive the from field as an (optional) argument from `mm-dissect-multipart'. (mm-dissect-multipart): Receive the from field as an argument and pass it on when we call `mm-dissect-buffer' on MIME parts. Fixes verification/decryption of signed/encrypted MIME parts.
author Miles Bader <miles@gnu.org>
date Mon, 28 Feb 2005 00:04:11 +0000
parents aac0a33f5772
children 18a818a2ee7c e4694597cbf4
line wrap: on
line diff
--- a/lisp/gnus/mm-decode.el	Sun Feb 27 23:42:14 2005 +0000
+++ b/lisp/gnus/mm-decode.el	Mon Feb 28 00:04:11 2005 +0000
@@ -509,10 +509,10 @@
     (message "Destroying external MIME viewers")
     (mm-destroy-parts mm-postponed-undisplay-list)))
 
-(defun mm-dissect-buffer (&optional no-strict-mime loose-mime)
+(defun mm-dissect-buffer (&optional no-strict-mime loose-mime from)
   "Dissect the current buffer and return a list of MIME handles."
   (save-excursion
-    (let (ct ctl type subtype cte cd description id result from)
+    (let (ct ctl type subtype cte cd description id result)
       (save-restriction
 	(mail-narrow-to-head)
 	(when (or no-strict-mime
@@ -523,8 +523,9 @@
 		cte (mail-fetch-field "content-transfer-encoding")
 		cd (mail-fetch-field "content-disposition")
 		description (mail-fetch-field "content-description")
-		from (mail-fetch-field "from")
 		id (mail-fetch-field "content-id"))
+	  (unless from
+		(setq from (mail-fetch-field "from")))
 	  ;; FIXME: In some circumstances, this code is running within
 	  ;; an unibyte macro.  mail-extract-address-components
 	  ;; creates unibyte buffers. This `if', though not a perfect
@@ -567,7 +568,7 @@
 					'from from
 					'start start)
 				  (car ctl))
-	     (cons (car ctl) (mm-dissect-multipart ctl))))
+	     (cons (car ctl) (mm-dissect-multipart ctl from))))
 	  (t
 	   (mm-possibly-verify-or-decrypt
 	    (mm-dissect-singlepart
@@ -594,7 +595,7 @@
     (mm-make-handle
      (mm-copy-to-buffer) ctl cte nil cdl description nil id)))
 
-(defun mm-dissect-multipart (ctl)
+(defun mm-dissect-multipart (ctl from)
   (goto-char (point-min))
   (let* ((boundary (concat "\n--" (mail-content-type-get ctl 'boundary)))
 	 (close-delimiter (concat (regexp-quote boundary) "--[ \t]*$"))
@@ -611,7 +612,7 @@
 	(save-excursion
 	  (save-restriction
 	    (narrow-to-region start (point))
-	    (setq parts (nconc (list (mm-dissect-buffer t)) parts)))))
+	    (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts)))))
       (end-of-line 2)
       (or (looking-at boundary)
 	  (forward-line 1))
@@ -620,7 +621,7 @@
       (save-excursion
 	(save-restriction
 	  (narrow-to-region start end)
-	  (setq parts (nconc (list (mm-dissect-buffer t)) parts)))))
+	  (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts)))))
     (mm-possibly-verify-or-decrypt (nreverse parts) ctl)))
 
 (defun mm-copy-to-buffer ()