diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2003-08-16 02:27:55 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-08-16 02:27:55 +0800 |
commit | a23c06806c9f5d8b1322a083fe05afef7b3f6379 (patch) | |
tree | 8650c6f60d49e412cbee0daec668081051db4d9d /camel/providers | |
parent | bda646ff757e869938df9181d82d632f8cb58486 (diff) | |
download | gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar.gz gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar.bz2 gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar.lz gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar.xz gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.tar.zst gsoc2013-evolution-a23c06806c9f5d8b1322a083fe05afef7b3f6379.zip |
Don't attach any filters to decode base64/qp/etc.
2003-08-15 Jeffrey Stedfast <fejj@ximian.com>
* providers/imap/camel-imap-wrapper.c (imap_wrapper_hydrate):
Don't attach any filters to decode base64/qp/etc.
svn path=/trunk/; revision=22247
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/imap/camel-imap-wrapper.c | 53 |
1 files changed, 5 insertions, 48 deletions
diff --git a/camel/providers/imap/camel-imap-wrapper.c b/camel/providers/imap/camel-imap-wrapper.c index 8559203c16..cdba687843 100644 --- a/camel/providers/imap/camel-imap-wrapper.c +++ b/camel/providers/imap/camel-imap-wrapper.c @@ -109,55 +109,12 @@ camel_imap_wrapper_get_type (void) static void imap_wrapper_hydrate (CamelImapWrapper *imap_wrapper, CamelStream *stream) { - CamelDataWrapper *data_wrapper = CAMEL_DATA_WRAPPER (imap_wrapper); - CamelStreamFilter *filterstream; - CamelMimeFilter *filter; - CamelContentType *ct; + CamelDataWrapper *data_wrapper = (CamelDataWrapper *) imap_wrapper; - filterstream = camel_stream_filter_new_with_stream (stream); - - /* FIXME: lame. We already have code to do all this shit in camel-mime-part-utils.c */ - switch (camel_mime_part_get_encoding (imap_wrapper->part)) { - case CAMEL_MIME_PART_ENCODING_BASE64: - filter = (CamelMimeFilter *)camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_BASE64_DEC); - camel_stream_filter_add (filterstream, filter); - break; - case CAMEL_MIME_PART_ENCODING_QUOTEDPRINTABLE: - filter = (CamelMimeFilter *)camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_QP_DEC); - camel_stream_filter_add (filterstream, filter); - break; - case CAMEL_MIME_PART_ENCODING_UUENCODE: - filter = (CamelMimeFilter *)camel_mime_filter_basic_new_type (CAMEL_MIME_FILTER_BASIC_UU_DEC); - camel_stream_filter_add (filterstream, filter); - break; - default: - filter = NULL; - } - - ct = camel_mime_part_get_content_type (imap_wrapper->part); - if (header_content_type_is (ct, "text", "*")) { - const char *charset; - - /* If we just did B64/QP/UU, need to also do CRLF->LF */ - if (filter) { - filter = camel_mime_filter_crlf_new (CAMEL_MIME_FILTER_CRLF_DECODE, - CAMEL_MIME_FILTER_CRLF_MODE_CRLF_ONLY); - camel_stream_filter_add (filterstream, filter); - } - - charset = header_content_type_param (ct, "charset"); - if (charset && !(strcasecmp (charset, "us-ascii") == 0 - || strcasecmp (charset, "utf-8") == 0)) { - filter = (CamelMimeFilter *)camel_mime_filter_charset_new_convert (charset, "UTF-8"); - if (filter) - camel_stream_filter_add (filterstream, filter); - } - } - - data_wrapper->stream = CAMEL_STREAM (filterstream); + data_wrapper->stream = stream; data_wrapper->offline = FALSE; - camel_object_unref (CAMEL_OBJECT (imap_wrapper->folder)); + camel_object_unref (imap_wrapper->folder); imap_wrapper->folder = NULL; g_free (imap_wrapper->uid); imap_wrapper->uid = NULL; @@ -207,7 +164,7 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder, CamelContentType *type, ((CamelDataWrapper *)imap_wrapper)->offline = TRUE; imap_wrapper->folder = imap_folder; - camel_object_ref (CAMEL_OBJECT (imap_folder)); + camel_object_ref (imap_folder); imap_wrapper->uid = g_strdup (uid); imap_wrapper->part_spec = g_strdup (part_spec); @@ -219,7 +176,7 @@ camel_imap_wrapper_new (CamelImapFolder *imap_folder, CamelContentType *type, TRUE, NULL); if (stream) { imap_wrapper_hydrate (imap_wrapper, stream); - camel_object_unref (CAMEL_OBJECT (stream)); + camel_object_unref (stream); } return (CamelDataWrapper *)imap_wrapper; |