evolution r36895 - branches/gnome-2-24/mail



Author: mcrha
Date: Mon Dec 15 11:58:23 2008
New Revision: 36895
URL: http://svn.gnome.org/viewvc/evolution?rev=36895&view=rev

Log:
2008-12-15  Milan Crha  <mcrha redhat com>

	** Fix for bug #564007

	* em-format.c: (emf_inlinepgp_encrypted): Guess the decrypted
	part mime type if not known from the decryptor, thus show the
	content really inline, if possible.



Modified:
   branches/gnome-2-24/mail/ChangeLog
   branches/gnome-2-24/mail/em-format.c

Modified: branches/gnome-2-24/mail/em-format.c
==============================================================================
--- branches/gnome-2-24/mail/em-format.c	(original)
+++ branches/gnome-2-24/mail/em-format.c	Mon Dec 15 11:58:23 2008
@@ -1653,6 +1653,8 @@
 	CamelCipherValidity *valid;
 	CamelException *ex;
 	CamelMimePart *opart;
+	CamelDataWrapper *dw;
+	char *mime_type;
 
 	cipher = camel_gpg_context_new(emf->session);
 	ex = camel_exception_new();
@@ -1671,6 +1673,19 @@
 		return;
 	}
 
+	dw = camel_medium_get_content_object ((CamelMedium *)opart);
+	mime_type = camel_data_wrapper_get_mime_type (dw);
+
+	/* this ensures to show the 'opart' as inlined, if possible */
+	if (mime_type && g_ascii_strcasecmp (mime_type, "application/octet-stream") == 0) {
+		const char *snoop = em_utils_snoop_type (opart);
+
+		if (snoop)
+			camel_data_wrapper_set_mime_type (dw, snoop);
+	}
+
+	g_free (mime_type);
+
 	/* Pass it off to the real formatter */
 	em_format_format_secure(emf, stream, opart, valid);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]