aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-12-15 19:57:55 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-12-15 19:57:55 +0800
commit1a5bb1cef60c2b271749afe0a075f60c510e9c74 (patch)
tree05619b327b819fb23c4b5bf6812e0ef81a232d6f
parenta7c7fdc59813ca956e8eef75f54b1b582e47e19a (diff)
downloadgsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar.gz
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar.bz2
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar.lz
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar.xz
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.tar.zst
gsoc2013-evolution-1a5bb1cef60c2b271749afe0a075f60c510e9c74.zip
** Fix for bug #564007
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. svn path=/trunk/; revision=36894
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/em-format.c15
2 files changed, 23 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index d1fd83f40d..f31c03bf5e 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,13 @@
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.
+
+2008-12-15 Milan Crha <mcrha@redhat.com>
+
** Part of fix for bug #563669
* em-account-editor.c: (emae_option_checkspin):
diff --git a/mail/em-format.c b/mail/em-format.c
index 9b05b1ef6e..4af272a3ff 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -1653,6 +1653,8 @@ emf_inlinepgp_encrypted(EMFormat *emf, CamelStream *stream, CamelMimePart *ipart
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 @@ emf_inlinepgp_encrypted(EMFormat *emf, CamelStream *stream, CamelMimePart *ipart
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);