aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/mbox
diff options
context:
space:
mode:
authorMichael Zucci <zucchi@src.gnome.org>2000-04-24 17:12:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-04-24 17:12:31 +0800
commit27937ec41f94720ffded271dff901dc74712845b (patch)
treeba02d3da7d25435df617d6ca166ccd2a360b136b /camel/providers/mbox
parent0c1a38160f5c97bfee3bad5d177ea3706069b993 (diff)
downloadgsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.gz
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.zst
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.zip
Big fixes for the last commit which broke the message creation entirely.
Plus an address decoder/formatter, etc. * camel-mime-message.c (construct_from_parser): Allow MESSAGE_END _or_ EOF as valid termination conditions. * providers/mbox/camel-mbox-summary.c (message_struct_new): Decode and then re-encode the addresses, so they are consistently formatted. * camel-mime-utils.c (header_decode_mailbox): Store the address in a _header_address. And try to get a comment-stored name if there is one. (header_decode_address): Actually return an address. (header_to_decode): Renamed to header_address_decode() (header_mailbox_decode): New function to get a single mailbox. (header_mime_decode): Return the major/minor value, as appropriate. (header_address_new, and friends): Whole bunch of utility functions for working with the address thingies. (header_decode_domain): Free the string header, and dont expand '.' into ' . '. (camel_mime_part_construct_content_from_parser): Oops, this was totally screwed up, try creating the right cotnent on the right object. svn path=/trunk/; revision=2579
Diffstat (limited to 'camel/providers/mbox')
-rw-r--r--camel/providers/mbox/camel-mbox-summary.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/camel/providers/mbox/camel-mbox-summary.c b/camel/providers/mbox/camel-mbox-summary.c
index 22060bf8fe..f1d4a41b7d 100644
--- a/camel/providers/mbox/camel-mbox-summary.c
+++ b/camel/providers/mbox/camel-mbox-summary.c
@@ -345,13 +345,29 @@ static CamelMboxMessageInfo *
message_struct_new(CamelMimeParser *mp, CamelMboxMessageContentInfo *parent, int start, int body, off_t xev_offset)
{
CamelMboxMessageInfo *ms;
+ struct _header_address *addr;
+ const char *text;
ms = g_malloc0(sizeof(*ms));
/* FIXME: what about cc, sender vs from? */
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));
+ text = camel_mime_parser_header(mp, "from", NULL);
+ addr = header_address_decode(text);
+ if (addr) {
+ ms->info.from = header_address_list_format(addr);
+ header_address_list_clear(&addr);
+ } else {
+ ms->info.from = g_strdup(text);
+ }
+ text = camel_mime_parser_header(mp, "to", NULL);
+ addr = header_address_decode(text);
+ if (addr) {
+ ms->info.to = header_address_list_format(addr);
+ header_address_list_clear(&addr);
+ } else {
+ ms->info.to = g_strdup(text);
+ }
ms->info.date_sent = header_decode_date(camel_mime_parser_header(mp, "date", NULL), NULL);
ms->info.date_received = 0;