From fceffac25c36de5195fe7b9f6d9faf32d54b41a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 18 Dec 2001 17:59:57 +0000 Subject: revert my "simplification" of the last commit, it was broken - I must have been brain-dead when I wrote it. svn path=/trunk/; revision=15149 --- camel/camel-mime-part-utils.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c index 08787df2cd..8367cecf37 100644 --- a/camel/camel-mime-part-utils.c +++ b/camel/camel-mime-part-utils.c @@ -194,7 +194,7 @@ static void simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser *mp) { CamelMimeFilter *fdec = NULL, *fcrlf = NULL; - CamelMimeFilterBasicType enctype; + CamelMimeFilterBasicType enctype = 0; int len, decid = -1, crlfid = -1; struct _header_content_type *ct; const char *charset = NULL; @@ -207,11 +207,20 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser /* first, work out conversion, if any, required, we dont care about what we dont know about */ encoding = header_content_encoding_decode (camel_mime_parser_header (mp, "Content-Transfer-Encoding", NULL)); if (encoding) { - enctype = camel_mime_part_encoding_from_string (encoding); + if (!strcasecmp (encoding, "base64")) { + d(printf("Adding base64 decoder ...\n")); + enctype = CAMEL_MIME_FILTER_BASIC_BASE64_DEC; + } else if (!strcasecmp (encoding, "quoted-printable")) { + d(printf("Adding quoted-printable decoder ...\n")); + enctype = CAMEL_MIME_FILTER_BASIC_QP_DEC; + } else if (!strcasecmp (encoding, "x-uuencode")) { + d(printf("Adding uudecoder ...\n")); + enctype = CAMEL_MIME_FILTER_BASIC_UU_DEC; + } g_free (encoding); - if (enctype != CAMEL_MIME_PART_ENCODING_DEFAULT) { - fdec = (CamelMimeFilter *) camel_mime_filter_basic_new_type (enctype); + if (enctype != 0) { + fdec = (CamelMimeFilter *)camel_mime_filter_basic_new_type(enctype); decid = camel_mime_parser_filter_add (mp, fdec); } } -- cgit v1.2.3