diff options
Diffstat (limited to 'camel/providers')
-rw-r--r-- | camel/providers/mbox/camel-mbox-folder.c | 13 | ||||
-rw-r--r-- | camel/providers/mbox/camel-mbox-summary.c | 21 |
2 files changed, 15 insertions, 19 deletions
diff --git a/camel/providers/mbox/camel-mbox-folder.c b/camel/providers/mbox/camel-mbox-folder.c index 75eb217e74..c1920bdd1c 100644 --- a/camel/providers/mbox/camel-mbox-folder.c +++ b/camel/providers/mbox/camel-mbox-folder.c @@ -856,8 +856,19 @@ _get_message_by_uid (CamelFolder *folder, const gchar *uid, CamelException *ex) ((CamelMboxMessageContentInfo *)info->info.content)->pos, ((CamelMboxMessageContentInfo *)info->info.content)->endpos); message = camel_mime_message_new(); +#if 1 + { + CamelMimeParser *parser; + + parser = camel_mime_parser_new(); + camel_mime_parser_init_with_stream(parser, message_stream); + camel_data_wrapper_construct_from_parser(message, parser); + gtk_object_unref((GtkObject *)parser); + gtk_object_unref((GtkObject *)message_stream); + } +#else camel_data_wrapper_set_input_stream (CAMEL_DATA_WRAPPER (message), message_stream); - +#endif /* init other fields? */ message->folder = folder; gtk_object_ref((GtkObject *)folder); diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c index aa6f85610a..22060bf8fe 100644 --- a/camel/providers/mbox/camel-mbox-summary.c +++ b/camel/providers/mbox/camel-mbox-summary.c @@ -341,21 +341,6 @@ body_part_new(CamelMimeParser *mp, CamelMboxMessageContentInfo *parent, int star return bs; } -static char *strdup_trim(const char *s) -{ - const char *end; - - if (s == NULL) - return NULL; - - while (isspace(*s)) - s++; - end = s+strlen(s)-1; - while (end>s && isspace(*end)) - end--; - return g_strndup(s, end-s+1); -} - static CamelMboxMessageInfo * message_struct_new(CamelMimeParser *mp, CamelMboxMessageContentInfo *parent, int start, int body, off_t xev_offset) { @@ -364,9 +349,9 @@ message_struct_new(CamelMimeParser *mp, CamelMboxMessageContentInfo *parent, int ms = g_malloc0(sizeof(*ms)); /* FIXME: what about cc, sender vs from? */ - ms->info.subject = strdup_trim(camel_mime_parser_header(mp, "subject", NULL)); - ms->info.from = strdup_trim(camel_mime_parser_header(mp, "from", NULL)); - ms->info.to = strdup_trim(camel_mime_parser_header(mp, "to", NULL)); + ms->info.subject = header_decode_string(camel_mime_parser_header(mp, "subject", NULL)); + ms->info.from = g_strdup(camel_mime_parser_header(mp, "from", NULL)); + ms->info.to = g_strdup(camel_mime_parser_header(mp, "to", NULL)); ms->info.date_sent = header_decode_date(camel_mime_parser_header(mp, "date", NULL), NULL); ms->info.date_received = 0; |