summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/imapwrapper.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (show 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
@@ -4,12 +4,13 @@
4#include <qpe/global.h> 4#include <qpe/global.h>
5#include <qapplication.h> 5#include <qapplication.h>
6#include "imapwrapper.h" 6#include "imapwrapper.h"
7#include "mailtypes.h" 7#include "mailtypes.h"
8#include "logindialog.h" 8#include "logindialog.h"
9#include <qprogressbar.h> 9#include <qprogressbar.h>
10#include "genericwrapper.h"
10 11
11using namespace Opie::Core; 12using namespace Opie::Core;
12int IMAPwrapper::mMax = 0; 13int IMAPwrapper::mMax = 0;
13int IMAPwrapper::mCurrent = 0; 14int IMAPwrapper::mCurrent = 0;
14 15
15IMAPwrapper::IMAPwrapper( IMAPaccount *a ) 16IMAPwrapper::IMAPwrapper( IMAPaccount *a )
@@ -453,14 +454,29 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
453 if ( item->att_data.att_static == NULL ) 454 if ( item->att_data.att_static == NULL )
454 continue; 455 continue;
455 if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { 456 if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) {
456 mailimap_envelope * head = item->att_data.att_static->att_data.att_env; 457 mailimap_envelope * head = item->att_data.att_static->att_data.att_env;
457 if ( head == NULL ) 458 if ( head == NULL )
458 continue; 459 continue;
459 if ( head->env_date != NULL ) 460 if ( head->env_date != NULL ) {
460 m->setDate(head->env_date); 461 m->setDate(head->env_date);
462 struct mailimf_date_time result;
463 struct mailimf_date_time* date = &result;
464 struct mailimf_date_time **re = &date;
465 size_t length = m->getDate().length();
466 size_t index = 0;
467 if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) {
468 m->setDate( Genericwrapper::parseDateTime( date ) );
469 char tmp[23];
470 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %05i",
471 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
472 m->setIsoDate( QString( tmp ) );
473 } else {
474 m->setIsoDate(head->env_date);
475 }
476 }
461 if ( head->env_subject != NULL ) 477 if ( head->env_subject != NULL )
462 m->setSubject(convert_String((const char*)head->env_subject)); 478 m->setSubject(convert_String((const char*)head->env_subject));
463 //m->setSubject(head->env_subject); 479 //m->setSubject(head->env_subject);
464 if (head->env_from!=NULL) { 480 if (head->env_from!=NULL) {
465 addresslist = address_list_to_stringlist(head->env_from->frm_list); 481 addresslist = address_list_to_stringlist(head->env_from->frm_list);
466 if (addresslist.count()) { 482 if (addresslist.count()) {