summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-01 19:41:57 (UTC)
committer zautrix <zautrix>2004-09-01 19:41:57 (UTC)
commitf255826bda2f95721aec4d6c9ba372d852fb9d0b (patch) (unidiff)
treedff43a1b3f933e91ffee864d20b7a6ded8bb1605
parent0cd2b8958ad93db27550b5e39d52e613b96b5e46 (diff)
downloadkdepimpi-f255826bda2f95721aec4d6c9ba372d852fb9d0b.zip
kdepimpi-f255826bda2f95721aec4d6c9ba372d852fb9d0b.tar.gz
kdepimpi-f255826bda2f95721aec4d6c9ba372d852fb9d0b.tar.bz2
Fixed a crash in mailwrapper
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index 1fd4bb1..9614d53 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -406,77 +406,76 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
406 if (r != MAIL_NO_ERROR) { 406 if (r != MAIL_NO_ERROR) {
407 ; // odebug << "Error filling message list" << oendl; 407 ; // odebug << "Error filling message list" << oendl;
408 if (env_list) { 408 if (env_list) {
409 mailmessage_list_free(env_list); 409 mailmessage_list_free(env_list);
410 } 410 }
411 return; 411 return;
412 } 412 }
413 mailimf_references * refs = 0; 413 mailimf_references * refs = 0;
414 mailimf_in_reply_to * in_replies = 0; 414 mailimf_in_reply_to * in_replies = 0;
415 uint32_t i = 0; 415 uint32_t i = 0;
416 for(; i < carray_count(env_list->msg_tab) ; ++i) { 416 for(; i < carray_count(env_list->msg_tab) ; ++i) {
417 mailmessage * msg; 417 mailmessage * msg;
418 QBitArray mFlags(7); 418 QBitArray mFlags(7);
419 msg = (mailmessage*)carray_get(env_list->msg_tab, i); 419 msg = (mailmessage*)carray_get(env_list->msg_tab, i);
420 if (msg->msg_fields == NULL) { 420 if (msg->msg_fields == NULL) {
421 //; // odebug << "could not fetch envelope of message " << i << "" << oendl; 421 //; // odebug << "could not fetch envelope of message " << i << "" << oendl;
422 continue; 422 continue;
423 } 423 }
424 RecMailP mail = new RecMail(); 424 RecMailP mail = new RecMail();
425 mail->setWrapper(this); 425 mail->setWrapper(this);
426 mail_flags * flag_result = 0; 426 mail_flags * flag_result = 0;
427 r = mailmessage_get_flags(msg,&flag_result); 427 r = mailmessage_get_flags(msg,&flag_result);
428 if (r == MAIL_ERROR_NOT_IMPLEMENTED) { 428 if (r == MAIL_ERROR_NOT_IMPLEMENTED) {
429 mFlags.setBit(FLAG_SEEN); 429 mFlags.setBit(FLAG_SEEN);
430 } 430 }
431 mailimf_single_fields single_fields; 431 mailimf_single_fields single_fields;
432 mailimf_single_fields_init(&single_fields, msg->msg_fields); 432 mailimf_single_fields_init(&single_fields, msg->msg_fields);
433 mail->setMsgsize(msg->msg_size); 433 mail->setMsgsize(msg->msg_size);
434 mail->setFlags(mFlags); 434 mail->setFlags(mFlags);
435 mail->setMbox(mailbox); 435 mail->setMbox(mailbox);
436 mail->setNumber(msg->msg_index); 436 mail->setNumber(msg->msg_index);
437 if (single_fields.fld_subject) 437 if (single_fields.fld_subject)
438 mail->setSubject( convert_String(single_fields.fld_subject->sbj_value)); 438 mail->setSubject( convert_String(single_fields.fld_subject->sbj_value));
439 if (single_fields.fld_from) 439 if (single_fields.fld_from)
440 mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list)); 440 mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list));
441 if (!mbox_as_to) { 441 if (!mbox_as_to) {
442 if (single_fields.fld_to) 442 if (single_fields.fld_to)
443 mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) ); 443 mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) );
444 } else { 444 } else {
445 mail->setTo(mailbox); 445 mail->setTo(mailbox);
446 } 446 }
447 if (single_fields.fld_cc) 447 if (single_fields.fld_cc)
448 mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) ); 448 mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) );
449 if (single_fields.fld_bcc) 449 if (single_fields.fld_bcc)
450 mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) ); 450 mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) );
451 if (single_fields.fld_orig_date) 451 if (single_fields.fld_orig_date)
452 mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) ); 452 mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) );
453 // crashes when accessing pop3 account? 453 // crashes when accessing pop3 account?
454 if (single_fields.fld_message_id->mid_value) { 454 if (single_fields.fld_message_id) {
455 mail->setMsgid(QString(single_fields.fld_message_id->mid_value)); 455 mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
456 ; // odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl; 456 ; // odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl;
457 } 457 }
458
459 if (single_fields.fld_reply_to) { 458 if (single_fields.fld_reply_to) {
460 QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list); 459 QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list);
461 if (t.count()>0) { 460 if (t.count()>0) {
462 mail->setReplyto(t[0]); 461 mail->setReplyto(t[0]);
463 } 462 }
464 } 463 }
465#if 0 464#if 0
466 refs = single_fields.fld_references; 465 refs = single_fields.fld_references;
467 if (refs && refs->mid_list && clist_count(refs->mid_list)) { 466 if (refs && refs->mid_list && clist_count(refs->mid_list)) {
468 char * text = (char*)refs->mid_list->first->data; 467 char * text = (char*)refs->mid_list->first->data;
469 mail->setReplyto(QString(text)); 468 mail->setReplyto(QString(text));
470 } 469 }
471#endif 470#endif
472 if (single_fields.fld_in_reply_to && single_fields.fld_in_reply_to->mid_list && 471 if (single_fields.fld_in_reply_to && single_fields.fld_in_reply_to->mid_list &&
473 clist_count(single_fields.fld_in_reply_to->mid_list)) { 472 clist_count(single_fields.fld_in_reply_to->mid_list)) {
474 mail->setInreply(parseInreplies(single_fields.fld_in_reply_to)); 473 mail->setInreply(parseInreplies(single_fields.fld_in_reply_to));
475 } 474 }
476 if ( maxSizeInKb == 0 || mail->Msgsize()<=maxSizeInKb*1024 ) 475 if ( maxSizeInKb == 0 || mail->Msgsize()<=maxSizeInKb*1024 )
477 target.append(mail); 476 target.append(mail);
478 } 477 }
479 if (env_list) { 478 if (env_list) {
480 mailmessage_list_free(env_list); 479 mailmessage_list_free(env_list);
481 } 480 }
482} 481}