aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-17 04:46:19 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-17 04:46:19 +0800
commit19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9 (patch)
tree0e3c9eea0e0da8789ccfe4ad6166238babefa9b5
parent1dea5ca33880b87d3d0be94867755aa69707a627 (diff)
downloadgsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar.gz
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar.bz2
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar.lz
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar.xz
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.tar.zst
gsoc2013-evolution-19ffc6d23e23f6b59f6c62b816647c9e7f9f54e9.zip
We don't have camel_pgp_mime_is_rfc2015_encrypted() anymore so just look
2003-07-16 Jeffrey Stedfast <fejj@ximian.com> * mail-format.c (handle_multipart_encrypted): We don't have camel_pgp_mime_is_rfc2015_encrypted() anymore so just look at the protocol for now. (mail_format_data_wrapper_write_to_stream): Updated for the new way camel handles content objects. svn path=/trunk/; revision=21844
-rw-r--r--mail/ChangeLog2
-rw-r--r--mail/mail-format.c70
2 files changed, 24 insertions, 48 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 7e64d8979a..b9ace9de54 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -3,6 +3,8 @@
* mail-format.c (handle_multipart_encrypted): We don't have
camel_pgp_mime_is_rfc2015_encrypted() anymore so just look at the
protocol for now.
+ (mail_format_data_wrapper_write_to_stream): Updated for the new
+ way camel handles content objects.
2003-07-15 Federico Mena Quintero <federico@ximian.com>
diff --git a/mail/mail-format.c b/mail/mail-format.c
index aea04ff5b7..2262a25385 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -3,7 +3,7 @@
* Authors: Dan Winship <danw@ximian.com>
* Jeffrey Stedfast <fejj@ximian.com>
*
- * Copyright 2000, 2003 Ximian, Inc.
+ * Copyright 2000-2003 Ximian, Inc. (www.ximian.com)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -1120,59 +1120,33 @@ ssize_t
mail_format_data_wrapper_write_to_stream (CamelDataWrapper *wrapper, MailDisplay *mail_display, CamelStream *stream)
{
CamelStreamFilter *filtered_stream;
+ CamelMimeFilterCharset *filter;
+ CamelContentType *content_type;
+ GConfClient *gconf;
ssize_t written;
+ char *charset;
+
+ gconf = mail_config_get_gconf_client ();
+
+ content_type = camel_data_wrapper_get_mime_type_field (wrapper);
+
+ /* find out the charset the user wants to override to */
+ if (mail_display && mail_display->charset)
+ charset = g_strdup (mail_display->charset);
+ else if (content_type && (charset = (char *) header_content_type_param (content_type, "charset")))
+ charset = g_strdup (charset);
+ else
+ charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
filtered_stream = camel_stream_filter_new_with_stream (stream);
- if (wrapper->rawtext || (mail_display && mail_display->charset)) {
- CamelMimeFilterCharset *filter;
- CamelContentType *content_type;
- GConfClient *gconf;
- char *charset;
-
- gconf = mail_config_get_gconf_client ();
-
- content_type = camel_data_wrapper_get_mime_type_field (wrapper);
-
- if (!wrapper->rawtext) {
- /* data wrapper had been successfully converted to UTF-8 using the mime
- part's charset, but the user thinks he knows best so we'll let him
- shoot himself in the foot here... */
-
- /* get the original charset of the mime part */
- charset = (char *) (content_type ? header_content_type_param (content_type, "charset") : NULL);
- if (!charset)
- charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
- else
- charset = g_strdup (charset);
-
- /* since the content is already in UTF-8, we need to decode into the
- original charset before we can convert back to UTF-8 using the charset
- the user is overriding with... */
- if ((filter = camel_mime_filter_charset_new_convert ("utf-8", charset))) {
- camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter));
- camel_object_unref (filter);
- }
-
- g_free (charset);
- }
-
- /* find out the charset the user wants to override to */
- if (mail_display && mail_display->charset)
- charset = g_strdup (mail_display->charset);
- else if (content_type && (charset = (char *) header_content_type_param (content_type, "charset")))
- charset = g_strdup (charset);
- else
- charset = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
-
- if ((filter = camel_mime_filter_charset_new_convert (charset, "utf-8"))) {
- camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter));
- camel_object_unref (filter);
- }
-
- g_free (charset);
+ if ((filter = camel_mime_filter_charset_new_convert (charset, "UTF-8"))) {
+ camel_stream_filter_add (filtered_stream, CAMEL_MIME_FILTER (filter));
+ camel_object_unref (filter);
}
+ g_free (charset);
+
written = camel_data_wrapper_write_to_stream (wrapper, CAMEL_STREAM (filtered_stream));
camel_stream_flush (CAMEL_STREAM (filtered_stream));
camel_object_unref (filtered_stream);