summaryrefslogtreecommitdiffabout
path: root/kmicromail/libmailwrapper/imapwrapper.cpp
Unidiff
Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp67
1 files changed, 36 insertions, 31 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp
index d9496af..93fb7de 100644
--- a/kmicromail/libmailwrapper/imapwrapper.cpp
+++ b/kmicromail/libmailwrapper/imapwrapper.cpp
@@ -436,39 +436,43 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
436 continue; 436 continue;
437 } 437 }
438 cf = flist->att_list->first; 438 cf = flist->att_list->first;
439 if( ! cf ) 439 if( cf ) {
440 for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { 440 for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) {
441 cflag = (mailimap_flag_fetch*)cf->data; 441 cflag = (mailimap_flag_fetch*)cf->data;
442 if( ! cflag ) 442 if( ! cflag )
443 qDebug("imap:not cflag "); 443 qDebug("imap:NO cflag ");
444 if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { 444 else {
445 switch (cflag->fl_flag->fl_type) { 445 if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) {
446 case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ 446 switch (cflag->fl_flag->fl_type) {
447 mFlags.setBit(FLAG_ANSWERED); 447 case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */
448 break; 448 mFlags.setBit(FLAG_ANSWERED);
449 case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */ 449 break;
450 mFlags.setBit(FLAG_FLAGGED); 450 case MAILIMAP_FLAG_FLAGGED: /* \Flagged flag */
451 break; 451 mFlags.setBit(FLAG_FLAGGED);
452 case MAILIMAP_FLAG_DELETED: /* \Deleted flag */ 452 break;
453 mFlags.setBit(FLAG_DELETED); 453 case MAILIMAP_FLAG_DELETED: /* \Deleted flag */
454 break; 454 mFlags.setBit(FLAG_DELETED);
455 case MAILIMAP_FLAG_SEEN: /* \Seen flag */ 455 break;
456 mFlags.setBit(FLAG_SEEN); 456 case MAILIMAP_FLAG_SEEN: /* \Seen flag */
457 break; 457 mFlags.setBit(FLAG_SEEN);
458 case MAILIMAP_FLAG_DRAFT: /* \Draft flag */ 458 break;
459 mFlags.setBit(FLAG_DRAFT); 459 case MAILIMAP_FLAG_DRAFT: /* \Draft flag */
460 break; 460 mFlags.setBit(FLAG_DRAFT);
461 case MAILIMAP_FLAG_KEYWORD: /* keyword flag */ 461 break;
462 break; 462 case MAILIMAP_FLAG_KEYWORD: /* keyword flag */
463 case MAILIMAP_FLAG_EXTENSION: /* \extension flag */ 463 break;
464 break; 464 case MAILIMAP_FLAG_EXTENSION: /* \extension flag */
465 default: 465 break;
466 break; 466 default:
467 break;
468 }
469 } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) {
470 mFlags.setBit(FLAG_RECENT);
471 }
467 } 472 }
468 } else if (cflag->fl_type==MAILIMAP_FLAG_FETCH_RECENT) {
469 mFlags.setBit(FLAG_RECENT);
470 } 473 }
471 } 474 }
475 //qDebug(" continue");
472 continue; 476 continue;
473 } 477 }
474 if ( item->att_data.att_static == NULL ) 478 if ( item->att_data.att_static == NULL )
@@ -485,6 +489,7 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
485 size_t length = m->getDate().length(); 489 size_t length = m->getDate().length();
486 size_t index = 0; 490 size_t index = 0;
487 if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) { 491 if ( mailimf_date_time_parse(head->env_date, length,&index, re ) == MAILIMF_NO_ERROR ) {
492 //qDebug("parseDateTime ");
488 QDateTime dt = Genericwrapper::parseDateTime( date ); 493 QDateTime dt = Genericwrapper::parseDateTime( date );
489 QString ret; 494 QString ret;
490 if ( dt.date() == QDate::currentDate () ) 495 if ( dt.date() == QDate::currentDate () )
@@ -607,7 +612,7 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
607 body_desc = item->att_data.att_static->att_data.att_body; 612 body_desc = item->att_data.att_static->att_data.att_body;
608 traverseBody(mail,body_desc,body,0,path); 613 traverseBody(mail,body_desc,body,0,path);
609 } else { 614 } else {
610 //odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; 615 qDebug("error fetching body %d (%d): %s", err, MAILIMAP_NO_ERROR, m_imap->imap_response );
611 } 616 }
612 if (result) mailimap_fetch_list_free(result); 617 if (result) mailimap_fetch_list_free(result);
613 return body; 618 return body;