summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 3e4293b..1caa375 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -128,25 +128,25 @@ QString Genericwrapper::getencoding(mailmime_mechanism*aEnc)
default:
if (aEnc->enc_token) {
enc = QString(aEnc->enc_token);
}
break;
}
return enc;
}
void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count)
{
if (current_rec >= 10) {
- odebug << "too deep recursion!" << oendl;
+ odebug << "too deep recursion!" << oendl;
}
if (!message || !mime) {
return;
}
int r;
char*data = 0;
size_t len;
clistiter * cur = 0;
QString b;
RecPartP part = new RecPart();
switch (mime->mm_type) {
@@ -265,25 +265,25 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list )
} else {
first = false;
}
switch ( addr->ad_type ) {
case MAILIMF_ADDRESS_MAILBOX:
result.append( parseMailbox( addr->ad_data.ad_mailbox ) );
break;
case MAILIMF_ADDRESS_GROUP:
result.append( parseGroup( addr->ad_data.ad_group ) );
break;
default:
- odebug << "Generic: unkown mailimf address type" << oendl;
+ odebug << "Generic: unkown mailimf address type" << oendl;
break;
}
}
return result;
}
QString Genericwrapper::parseGroup( mailimf_group *group )
{
QString result( "" );
result.append( group->grp_display_name );
@@ -358,25 +358,25 @@ QString Genericwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part)
return text;
}
void Genericwrapper::cleanMimeCache()
{
QMap<QString,encodedString*>::Iterator it = bodyCache.begin();
for (;it!=bodyCache.end();++it) {
encodedString*t = it.data();
//it.setValue(0);
if (t) delete t;
}
bodyCache.clear();
- odebug << "Genericwrapper: cache cleaned" << oendl;
+ odebug << "Genericwrapper: cache cleaned" << oendl;
}
QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
{
QStringList res;
if (!in_replies || !in_replies->mid_list) return res;
clistiter * current = 0;
for ( current = clist_begin( in_replies->mid_list ); current != NULL; current = current->next ) {
QString h((char*)current->data);
while (h.length()>0 && h[0]=='<') {
h.remove(0,1);
}
@@ -387,44 +387,44 @@ QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
res.append(h);
}
}
return res;
}
void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
{
int r;
mailmessage_list * env_list = 0;
r = mailsession_get_messages_list(session,&env_list);
if (r != MAIL_NO_ERROR) {
- odebug << "Error message list" << oendl;
+ odebug << "Error message list" << oendl;
return;
}
r = mailsession_get_envelopes_list(session, env_list);
if (r != MAIL_NO_ERROR) {
- odebug << "Error filling message list" << oendl;
+ odebug << "Error filling message list" << oendl;
if (env_list) {
mailmessage_list_free(env_list);
}
return;
}
mailimf_references * refs = 0;
mailimf_in_reply_to * in_replies = 0;
uint32_t i = 0;
for(; i < carray_count(env_list->msg_tab) ; ++i) {
mailmessage * msg;
QBitArray mFlags(7);
msg = (mailmessage*)carray_get(env_list->msg_tab, i);
if (msg->msg_fields == NULL) {
- //odebug << "could not fetch envelope of message " << i << "" << oendl;
+ //odebug << "could not fetch envelope of message " << i << "" << oendl;
continue;
}
RecMailP mail = new RecMail();
mail->setWrapper(this);
mail_flags * flag_result = 0;
r = mailmessage_get_flags(msg,&flag_result);
if (r == MAIL_ERROR_NOT_IMPLEMENTED) {
mFlags.setBit(FLAG_SEEN);
}
mailimf_single_fields single_fields;
mailimf_single_fields_init(&single_fields, msg->msg_fields);
mail->setMsgsize(msg->msg_size);
@@ -439,27 +439,26 @@ void Genericwrapper::parseList(QValueList<Opie::Core::OSmartPointer<RecMail> > &
if (single_fields.fld_to)
mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) );
} else {
mail->setTo(mailbox);
}
if (single_fields.fld_cc)
mail->setCC( parseAddressList( single_fields.fld_cc->cc_addr_list ) );
if (single_fields.fld_bcc)
mail->setBcc( parseAddressList( single_fields.fld_bcc->bcc_addr_list ) );
if (single_fields.fld_orig_date)
mail->setDate( parseDateTime( single_fields.fld_orig_date->dt_date_time ) );
// crashes when accessing pop3 account?
- if (single_fields.fld_message_id->mid_value) {
+ if (single_fields.fld_message_id && single_fields.fld_message_id->mid_value) {
mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
- odebug << "Msgid == " << mail->Msgid().latin1() << "" << oendl;
}
if (single_fields.fld_reply_to) {
QStringList t = parseAddressList(single_fields.fld_reply_to->rt_addr_list);
if (t.count()>0) {
mail->setReplyto(t[0]);
}
}
#if 0
refs = single_fields.fld_references;
if (refs && refs->mid_list && clist_count(refs->mid_list)) {
char * text = (char*)refs->mid_list->first->data;