From 242ffb8b8efa42579d6b36339f86f09b894c525e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 21 Jun 2000 18:15:27 +0000 Subject: Set date_received based on the first (most recent) "Received" header. * camel-folder-summary.c (message_info_new): Set date_received based on the first (most recent) "Received" header. svn path=/trunk/; revision=3677 --- camel/ChangeLog | 5 +++++ camel/camel-folder-summary.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index c35d9ddcad..ba8d9e709a 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,8 @@ +2000-06-21 Dan Winship + + * camel-folder-summary.c (message_info_new): Set date_received + based on the first (most recent) "Received" header. + 2000-06-20 Dan Winship * camel-mime-part.c (write_to_stream): flush the filter stream diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 175737d1cf..dd99921924 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -961,6 +961,7 @@ static CamelMessageInfo * message_info_new(CamelFolderSummary *s, struct _header_raw *h) { CamelMessageInfo *mi; + char *received; mi = g_malloc0(s->message_info_size); @@ -969,7 +970,13 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h) mi->to = summary_format_address(h, "to"); mi->user_flags = NULL; mi->date_sent = header_decode_date(header_raw_find(&h, "date", NULL), NULL); - mi->date_received = 0; + received = header_raw_find(&h, "received", NULL); + if (received) + received = strrchr(received, ';'); + if (received) + mi->date_received = header_decode_date(received + 1, NULL); + else + mi->date_received = 0; mi->message_id = header_msgid_decode(header_raw_find(&h, "message-id", NULL)); /* if we have a references, use that, otherwise, see if we have an in-reply-to header, with parsable content, otherwise *shrug* */ -- cgit