summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/imapwrapper.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index 6faa524..5441a9b 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -7,6 +7,7 @@
#include "mailtypes.h"
#include "logindialog.h"
#include <qprogressbar.h>
+#include "genericwrapper.h"
using namespace Opie::Core;
int IMAPwrapper::mMax = 0;
@@ -456,8 +457,23 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
mailimap_envelope * head = item->att_data.att_static->att_data.att_env;
if ( head == NULL )
continue;
- if ( head->env_date != NULL )
+ if ( head->env_date != NULL ) {
m->setDate(head->env_date);
+ struct mailimf_date_time result;
+ struct mailimf_date_time* date = &result;
+ struct mailimf_date_time **re = &date;
+ size_t length = m->getDate().length();
+ size_t index = 0;
+ if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) {
+ m->setDate( Genericwrapper::parseDateTime( date ) );
+ char tmp[23];
+ snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %05i",
+ date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
+ m->setIsoDate( QString( tmp ) );
+ } else {
+ m->setIsoDate(head->env_date);
+ }
+ }
if ( head->env_subject != NULL )
m->setSubject(convert_String((const char*)head->env_subject));
//m->setSubject(head->env_subject);