diff options
author | Milan Crha <mcrha@redhat.com> | 2010-10-13 22:28:43 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-10-13 22:28:43 +0800 |
commit | 26b7d1f342e19ed828c4d3a3b99b15987fddeb94 (patch) | |
tree | 1b9543a84db93fa8fb06ba919139bc616c29f2c8 /em-format | |
parent | c83faa7078cc1fd280ac573b07645e8464b2fdc4 (diff) | |
download | gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.gz gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.zst gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.zip |
Bug #630375 - Character encoding of GPG encrypted message not honored
Diffstat (limited to 'em-format')
-rw-r--r-- | em-format/em-format.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c index 9574530109..dc20ac596d 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1487,6 +1487,22 @@ add_validity_found (EMFormat *emf, /* ********************************************************************** */ +static void +preserve_charset_in_content_type (CamelMimePart *ipart, CamelMimePart *opart) +{ + CamelContentType *ict; + + g_return_if_fail (ipart != NULL); + g_return_if_fail (opart != NULL); + + ict = camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (ipart))); + if (!ict || !camel_content_type_param (ict, "charset") || !*camel_content_type_param (ict, "charset")) + return; + + camel_content_type_set_param (camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (opart))), + "charset", camel_content_type_param (ict, "charset")); +} + #ifdef ENABLE_SMIME static void emf_application_xpkcs7mime (EMFormat *emf, @@ -1521,6 +1537,7 @@ emf_application_xpkcs7mime (EMFormat *emf, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( context, part, opart, cancellable, &local_error); + preserve_charset_in_content_type (part, opart); if (valid == NULL) { em_format_format_error ( emf, stream, "%s", @@ -1733,6 +1750,7 @@ emf_multipart_encrypted (EMFormat *emf, opart = camel_mime_part_new (); valid = camel_cipher_context_decrypt_sync ( context, part, opart, cancellable, &local_error); + preserve_charset_in_content_type (part, opart); if (valid == NULL) { em_format_format_error ( emf, stream, local_error->message ? @@ -2233,6 +2251,7 @@ emf_inlinepgp_encrypted (EMFormat *emf, camel_data_wrapper_set_mime_type (dw, snoop); } + preserve_charset_in_content_type (ipart, opart); g_free (mime_type); add_validity_found (emf, valid); |