aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-03-22 08:19:58 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-03-22 08:19:58 +0800
commit209b7548bc44dc587b37e64bc412d68bc400bdda (patch)
treeaa5bae08cebde81074d6f1f09cc8188f1d42fd96 /camel
parent46c0e7a0544b752300c6be67110814fe8dccf3aa (diff)
downloadgsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar.gz
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar.bz2
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar.lz
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar.xz
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.tar.zst
gsoc2013-evolution-209b7548bc44dc587b37e64bc412d68bc400bdda.zip
Use the date in the received header for the received_date.
2002-03-21 Jeffrey Stedfast <fejj@ximian.com> * camel-folder-summary.c (camel_message_info_new_from_header): Use the date in the received header for the received_date. svn path=/trunk/; revision=16225
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel-folder-summary.c23
2 files changed, 22 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index b7210ba8b5..6b10dade6e 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2002-03-21 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-folder-summary.c (camel_message_info_new_from_header): Use
+ the date in the received header for the received_date.
+
2002-03-19 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-utils.c (header_encode_param): Fix this to work
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 44ca09fb80..a424aef8de 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -2447,10 +2447,10 @@ CamelMessageInfo *
camel_message_info_new_from_header (struct _header_raw *header)
{
CamelMessageInfo *info;
- char *subject, *from, *to, *cc, *date, *mlist;
+ char *subject, *from, *to, *cc, *mlist;
struct _header_content_type *ct = NULL;
- const char *content, *charset = NULL;
-
+ const char *content, *date, *charset = NULL;
+
if ((content = header_raw_find(&header, "Content-Type", NULL))
&& (ct = header_content_type_decode(content))
&& (charset = header_content_type_param(ct, "charset"))
@@ -2463,7 +2463,7 @@ camel_message_info_new_from_header (struct _header_raw *header)
from = summary_format_address(header, "from");
to = summary_format_address(header, "to");
cc = summary_format_address(header, "cc");
- date = header_raw_find (&header, "Date", NULL);
+ date = header_raw_find(&header, "date", NULL);
mlist = header_raw_check_mailing_list(&header);
if (ct)
@@ -2477,8 +2477,19 @@ camel_message_info_new_from_header (struct _header_raw *header)
camel_message_info_set_cc(info, cc);
camel_message_info_set_mlist(info, mlist);
- info->date_sent = header_decode_date (date, NULL);
- info->date_received = header_decode_date (date, NULL);
+ if (date)
+ info->date_sent = header_decode_date (date, NULL);
+ else
+ info->date_sent = time (NULL);
+
+ date = header_raw_find (&header, "received", NULL);
+ if (date && (date = strrchr (date, ';')))
+ date++;
+
+ if (date)
+ info->date_received = header_decode_date (date, NULL);
+ else
+ info->date_received = time (NULL);
return info;
}