aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-25 23:29:12 +0800
committerDan Winship <danw@src.gnome.org>2000-04-25 23:29:12 +0800
commita595bef60481ac75a513a2d21131e40a4168f522 (patch)
tree4283b3bb1a16c4e78e10509731b30f6a7d80845d /mail
parent9713f20bc88573b3716d1b0ba97ac2b4743d150b (diff)
downloadgsoc2013-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')
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/mail-format.c22
2 files changed, 21 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index ed1366124a..0789226ed8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2000-04-25 Dan Winship <danw@helixcode.com>
+ * 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.
+
* mail-display.c, mail-format.c: Redo large chunks of this. The
mail display now consists of a vbox in a scrolled window, in which
we put multiple GtkHTML objects. This means broken HTML in one
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;
}