aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-10-13 22:28:43 +0800
committerMilan Crha <mcrha@redhat.com>2010-10-13 22:28:43 +0800
commit26b7d1f342e19ed828c4d3a3b99b15987fddeb94 (patch)
tree1b9543a84db93fa8fb06ba919139bc616c29f2c8 /em-format
parentc83faa7078cc1fd280ac573b07645e8464b2fdc4 (diff)
downloadgsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.gz
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.bz2
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.lz
gsoc2013-evolution-26b7d1f342e19ed828c4d3a3b99b15987fddeb94.tar.xz
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.c19
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);