summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-02 14:46:42 (UTC)
committer alwin <alwin>2004-01-02 14:46:42 (UTC)
commitf238d6cc096cd1baf3e821af80ecd51917d615ad (patch) (side-by-side diff)
tree28ea5754277dad74a01adba74c5bf0336fa075f5
parenteac3f38c7d1c56a1800894a488e9ce35ddeb396c (diff)
downloadopie-f238d6cc096cd1baf3e821af80ecd51917d615ad.zip
opie-f238d6cc096cd1baf3e821af80ecd51917d615ad.tar.gz
opie-f238d6cc096cd1baf3e821af80ecd51917d615ad.tar.bz2
bugfix while assigning mail-numbers
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/genericwrapper.cpp2
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/mail/genericwrapper.cpp b/noncore/net/mail/genericwrapper.cpp
index 5de9299..62116ba 100644
--- a/noncore/net/mail/genericwrapper.cpp
+++ b/noncore/net/mail/genericwrapper.cpp
@@ -438,49 +438,49 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
return;
}
mailimf_references * refs;
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) {
qDebug("could not fetch envelope of message %i", i);
continue;
}
RecMail * 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);
mail->setFlags(mFlags);
mail->setMbox(mailbox);
- mail->setNumber(i+1);
+ mail->setNumber(msg->msg_index);
if (single_fields.fld_subject)
mail->setSubject( convert_String(single_fields.fld_subject->sbj_value));
if (single_fields.fld_from)
mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list));
if (single_fields.fld_to)
mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) );
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 ) );
if (single_fields.fld_message_id->mid_value)
mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
refs = single_fields.fld_references;
if (refs && refs->mid_list && clist_count(refs->mid_list)) {
char * text = (char*)refs->mid_list->first->data;
mail->setReplyto(QString(text));
}
target.append(mail);
}
if (env_list) {
mailmessage_list_free(env_list);
}
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 5de9299..62116ba 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -438,49 +438,49 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
return;
}
mailimf_references * refs;
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) {
qDebug("could not fetch envelope of message %i", i);
continue;
}
RecMail * 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);
mail->setFlags(mFlags);
mail->setMbox(mailbox);
- mail->setNumber(i+1);
+ mail->setNumber(msg->msg_index);
if (single_fields.fld_subject)
mail->setSubject( convert_String(single_fields.fld_subject->sbj_value));
if (single_fields.fld_from)
mail->setFrom(parseMailboxList(single_fields.fld_from->frm_mb_list));
if (single_fields.fld_to)
mail->setTo( parseAddressList( single_fields.fld_to->to_addr_list ) );
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 ) );
if (single_fields.fld_message_id->mid_value)
mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
refs = single_fields.fld_references;
if (refs && refs->mid_list && clist_count(refs->mid_list)) {
char * text = (char*)refs->mid_list->first->data;
mail->setReplyto(QString(text));
}
target.append(mail);
}
if (env_list) {
mailmessage_list_free(env_list);
}