aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-06-02 06:08:07 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-06-02 06:08:07 +0800
commit7e6624257538df294f3dbd5f717ceba0d6ab43ab (patch)
treeb3ae7bd2466efd345ccd650e066b4541870d9bcd /camel
parentc7ea21299d51a17280e2400bda29e80bcf01cb73 (diff)
downloadgsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar.gz
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar.bz2
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar.lz
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar.xz
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.tar.zst
gsoc2013-evolution-7e6624257538df294f3dbd5f717ceba0d6ab43ab.zip
Fixes Bug 192.
2000-06-01 Not Zed <NotZed@HelixCode.com> * camel-mime-part.c (construct_from_parser): For a message part, set the default content-type to message/rfc822. Maybe needs to be done for multiparts too? 2000-05-31 Not Zed <NotZed@HelixCode.com> * camel-mime-message.c (construct_from_parser): Typo in assersion. * camel-mime-parser.c (folder_scan_step): Use a default type of message/rfc822 for multipart/digest. Bug Z192. (folder_scan_drop_step): Remove warning. svn path=/trunk/; revision=3340
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog14
-rw-r--r--camel/camel-mime-message.c4
-rw-r--r--camel/camel-mime-parser.c22
-rw-r--r--camel/camel-mime-part-utils.c1
-rw-r--r--camel/camel-mime-part.c4
5 files changed, 39 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index f270abcad2..539534804b 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,17 @@
+2000-06-01 Not Zed <NotZed@HelixCode.com>
+
+ * camel-mime-part.c (construct_from_parser): For a message part,
+ set the default content-type to message/rfc822. Maybe needs to be
+ done for multiparts too?
+
+2000-05-31 Not Zed <NotZed@HelixCode.com>
+
+ * camel-mime-message.c (construct_from_parser): Typo in assersion.
+
+ * camel-mime-parser.c (folder_scan_step): Use a default type of
+ message/rfc822 for multipart/digest. Bug Z192.
+ (folder_scan_drop_step): Remove warning.
+
2000-05-30 Not Zed <NotZed@HelixCode.com>
* providers/mbox/camel-mbox-folder.c (mbox_append_message): Init
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index 8fca516fd0..5959e59933 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -575,12 +575,12 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
/* ... then clean up the follow-on state */
state = camel_mime_parser_step(mp, &buf, &len);
switch (state) {
- case HSCAN_EOF: case HSCAN_FROM_END: /* this doesn't belong to us */
+ case HSCAN_EOF: case HSCAN_FROM_END: /* these doesn't belong to us */
camel_mime_parser_unstep(mp);
case HSCAN_MESSAGE_END:
break;
default:
- g_error("Bad parser state: Expecing MESSAGE_END or EOF or ROM, got: %d", camel_mime_parser_state(mp));
+ g_error("Bad parser state: Expecing MESSAGE_END or EOF or EOM, got: %d", camel_mime_parser_state(mp));
camel_mime_parser_unstep(mp);
return -1;
}
diff --git a/camel/camel-mime-parser.c b/camel/camel-mime-parser.c
index 74c7653df3..acb29814d2 100644
--- a/camel/camel-mime-parser.c
+++ b/camel/camel-mime-parser.c
@@ -1466,10 +1466,16 @@ folder_scan_step(struct _header_scan_state *s, char **databuffer, int *datalengt
tail_recurse:
d({
printf("\nSCAN STACK:\n");
- printf(" '%s' :\n", states[s->state]);
+ printf(" '%s' :\n", states[s->state]);
hb = s->parts;
while (hb) {
- printf(" '%s' : %s\n", states[hb->savestate], hb->boundary);
+ printf(" '%s' : %s ", states[hb->savestate], hb->boundary);
+ if (hb->content_type) {
+ printf("(%s/%s)", hb->content_type->type, hb->content_type->subtype);
+ } else {
+ printf("(default)");
+ }
+ printf("\n");
hb = hb->parent;
}
printf("\n");
@@ -1543,6 +1549,16 @@ tail_recurse:
type = HSCAN_MESSAGE;
}
}
+ } else {
+ /* make the default type for multipart/digest be message/rfc822 */
+ if ((s->parts
+ && header_content_type_is(s->parts->content_type, "multipart", "digest"))) {
+ ct = header_content_type_decode("message/rfc822");
+ type = HSCAN_MESSAGE;
+ d(printf("parent was multipart/digest, autoupgrading to message/rfc822?\n"));
+ /* maybe we should do this too?
+ header_raw_append_parse(&h->headers, "Content-Type: message/rfc822", -1);*/
+ }
}
h->content_type = ct;
folder_push_part(s, h);
@@ -1667,6 +1683,8 @@ folder_scan_drop_step(struct _header_scan_state *s)
s->state &= ~HSCAN_END;
}
return;
+ default:
+ /* FIXME: not sure if this is entirely right */
}
}
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index f2b67416ac..304f343758 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -193,7 +193,6 @@ camel_mime_part_construct_content_from_parser(CamelMimePart *dw, CamelMimeParser
/* FIXME: use the real boundary? */
camel_multipart_set_boundary((CamelMultipart *)content, NULL);
-
while (camel_mime_parser_step(mp, &buf, &len) != HSCAN_MULTIPART_END) {
camel_mime_parser_unstep(mp);
bodypart = (CamelDataWrapper *)camel_mime_part_new();
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index d727c98811..49cf6aa0a1 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -557,8 +557,10 @@ construct_from_parser(CamelMimePart *dw, CamelMimeParser *mp)
d(printf("mime_part::construct_from_parser()\n"));
switch (camel_mime_parser_step(mp, &buf, &len)) {
- case HSCAN_HEADER:
case HSCAN_MESSAGE:
+ /* set the default type of a message always */
+ gmime_content_field_construct_from_string (dw->content_type, "message/rfc822");
+ case HSCAN_HEADER:
case HSCAN_MULTIPART:
/* we have the headers, build them into 'us' */
headers = camel_mime_parser_headers_raw(mp);