diff options
author | Dan Winship <danw@src.gnome.org> | 2000-04-25 23:29:12 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-04-25 23:29:12 +0800 |
commit | a595bef60481ac75a513a2d21131e40a4168f522 (patch) | |
tree | 4283b3bb1a16c4e78e10509731b30f6a7d80845d /mail/mail-format.c | |
parent | 9713f20bc88573b3716d1b0ba97ac2b4743d150b (diff) | |
download | gsoc2013-evolution-a595bef60481ac75a513a2d21131e40a4168f522.tar.gz gsoc2013-evolution-a595bef60481ac75a513a2d21131e40a4168f522.tar.zst gsoc2013-evolution-a595bef60481ac75a513a2d21131e40a4168f522.zip |
Fix some bugs that crept into reply generation. This needs a lot more work
* mail-format.c (reply_body): Fix some bugs that crept into reply
generation. This needs a lot more work to deal correctly with
complicated bodies.
svn path=/trunk/; revision=2602
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index 08a2f98f98..6d303f49fb 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -983,7 +983,7 @@ reply_body (CamelDataWrapper *data, gboolean *html) { CamelMultipart *mp; CamelMimePart *subpart; - int i, nparts; + int i, nparts, disparts; char *subtext, *old; const char *boundary, *disp, *subtype; char *text = NULL; @@ -1036,14 +1036,23 @@ reply_body (CamelDataWrapper *data, gboolean *html) * - are text/plain or message * - are not explicitly tagged with non-inline disposition */ + *html = FALSE; boundary = camel_multipart_get_boundary (mp); - for (i = 0; i < nparts; i++) { + for (i = disparts = 0; i < nparts; i++) { subpart = CAMEL_MIME_PART (camel_multipart_get_part (mp, i)); + mime_type = camel_mime_part_get_content_type (subpart); + if (strcasecmp (mime_type->type, "text") == 0) { + if (strcasecmp (mime_type->subtype, "plain") != 0) + continue; + } else if (strcasecmp (mime_type->type, "message") != 0) + continue; + disp = camel_mime_part_get_disposition (subpart); if (disp && strcasecmp (disp, "inline") != 0) continue; + data = camel_medium_get_content_object (CAMEL_MEDIUM (subpart)); subtext = get_data_wrapper_text (data); if (text) { old = text; @@ -1051,6 +1060,7 @@ reply_body (CamelDataWrapper *data, gboolean *html) boundary, subtext); g_free (subtext); g_free (old); + disparts++; } else text = subtext; } @@ -1058,9 +1068,11 @@ reply_body (CamelDataWrapper *data, gboolean *html) if (!text) return NULL; - old = text; - text = g_strdup_printf ("%s\n--%s--\n", text, boundary); - g_free (old); + if (disparts > 1) { + old = text; + text = g_strdup_printf ("%s\n--%s--\n", text, boundary); + g_free (old); + } return text; } |