author | zautrix <zautrix> | 2004-09-10 20:16:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-10 20:16:14 (UTC) |
commit | 768ce5ccec90c1b062b749e7ad0464d09760b91c (patch) (unidiff) | |
tree | 78523f09e276d6ac881ff20905ddacee1851af66 | |
parent | cebdd6de7481514ad5ea0517f7a2e8f4db422be5 (diff) | |
download | kdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.zip kdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.tar.gz kdepimpi-768ce5ccec90c1b062b749e7ad0464d09760b91c.tar.bz2 |
Some imap fixes
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index be825ef..ca1c7f1 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -402,16 +402,21 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
402 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { | 402 | for (c = clist_begin(m_att->att_list); c!=NULL;c=clist_next(c) ) { |
403 | current = c; | 403 | current = c; |
404 | size = 0; | 404 | size = 0; |
405 | item = (mailimap_msg_att_item*)current->data; | 405 | item = (mailimap_msg_att_item*)current->data; |
406 | if ( !item ) | ||
407 | continue; | ||
406 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { | 408 | if (item->att_type!=MAILIMAP_MSG_ATT_ITEM_STATIC) { |
407 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; | 409 | flist = (mailimap_msg_att_dynamic*)item->att_data.att_dyn; |
408 | if (!flist->att_list) { | 410 | if (!flist || !flist->att_list) { |
409 | continue; | 411 | continue; |
410 | } | 412 | } |
411 | cf = flist->att_list->first; | 413 | cf = flist->att_list->first; |
414 | if( ! cf ) | ||
412 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { | 415 | for (cf = clist_begin(flist->att_list); cf!=NULL; cf = clist_next(cf)) { |
413 | cflag = (mailimap_flag_fetch*)cf->data; | 416 | cflag = (mailimap_flag_fetch*)cf->data; |
417 | if( ! cflag ) | ||
418 | qDebug("imap:not cflag "); | ||
414 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { | 419 | if (cflag->fl_type==MAILIMAP_FLAG_FETCH_OTHER && cflag->fl_flag!=0) { |
415 | switch (cflag->fl_flag->fl_type) { | 420 | switch (cflag->fl_flag->fl_type) { |
416 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ | 421 | case MAILIMAP_FLAG_ANSWERED: /* \Answered flag */ |
417 | mFlags.setBit(FLAG_ANSWERED); | 422 | mFlags.setBit(FLAG_ANSWERED); |
@@ -440,12 +445,18 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
440 | } | 445 | } |
441 | } | 446 | } |
442 | continue; | 447 | continue; |
443 | } | 448 | } |
449 | if ( item->att_data.att_static == NULL ) | ||
450 | continue; | ||
444 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { | 451 | if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) { |
445 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; | 452 | mailimap_envelope * head = item->att_data.att_static->att_data.att_env; |
446 | m->setDate(head->env_date); | 453 | if ( head == NULL ) |
447 | m->setSubject(convert_String((const char*)head->env_subject)); | 454 | continue; |
455 | if ( head->env_date != NULL ) | ||
456 | m->setDate(head->env_date); | ||
457 | if ( head->env_subject != NULL ) | ||
458 | m->setSubject(convert_String((const char*)head->env_subject)); | ||
448 | //m->setSubject(head->env_subject); | 459 | //m->setSubject(head->env_subject); |
449 | if (head->env_from!=NULL) { | 460 | if (head->env_from!=NULL) { |
450 | addresslist = address_list_to_stringlist(head->env_from->frm_list); | 461 | addresslist = address_list_to_stringlist(head->env_from->frm_list); |
451 | if (addresslist.count()) { | 462 | if (addresslist.count()) { |
@@ -482,9 +493,9 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
482 | if (h.length()>0) { | 493 | if (h.length()>0) { |
483 | m->setInreply(QStringList(h)); | 494 | m->setInreply(QStringList(h)); |
484 | } | 495 | } |
485 | } | 496 | } |
486 | if (head->env_message_id) { | 497 | if (head->env_message_id != NULL) { |
487 | m->setMsgid(QString(head->env_message_id)); | 498 | m->setMsgid(QString(head->env_message_id)); |
488 | } | 499 | } |
489 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { | 500 | } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_INTERNALDATE) { |
490 | #if 0 | 501 | #if 0 |