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
@@ -1,25 +1,26 @@
// CHANGED 2004-09-31 Lutz Rogowski
#include <stdlib.h>
#include <libetpan/libetpan.h>
#include <qpe/global.h>
#include <qapplication.h>
#include "imapwrapper.h"
#include "mailtypes.h"
#include "logindialog.h"
#include <qprogressbar.h>
+#include "genericwrapper.h"
using namespace Opie::Core;
int IMAPwrapper::mMax = 0;
int IMAPwrapper::mCurrent = 0;
IMAPwrapper::IMAPwrapper( IMAPaccount *a )
: AbstractMail()
{
account = a;
m_imap = 0;
m_Lastmbox = "";
mCurrent = 0;
mMax = 0;
}
IMAPwrapper::~IMAPwrapper()
@@ -443,34 +444,49 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
break;
default:
break;
}
} else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) {
mFlags.setBit(FLAG_RECENT);
}
}
continue;
}
if ( item->att_data.att_static == NULL )
continue;
if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) {
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);
if (head->env_from!=NULL) {
addresslist = address_list_to_stringlist(head->env_from->frm_list);
if (addresslist.count()) {
m->setFrom(addresslist.first());
}
}
if (head->env_to!=NULL) {
addresslist = address_list_to_stringlist(head->env_to->to_list);
m->setTo(addresslist);
}
if (head->env_cc!=NULL) {
addresslist = address_list_to_stringlist(head->env_cc->cc_list);
m->setCC(addresslist);