summaryrefslogtreecommitdiff
path: root/noncore/net
authoralwin <alwin>2004-01-08 21:51:32 (UTC)
committer alwin <alwin>2004-01-08 21:51:32 (UTC)
commitfb30e3e116d8616cb05b3765ae1aed5f7e96c74e (patch) (side-by-side diff)
tree393ebb7b913c01697146ac804d980f8b8713f81a /noncore/net
parentb672058ac470a1b9534296fa8bc4b8725ab7913b (diff)
downloadopie-fb30e3e116d8616cb05b3765ae1aed5f7e96c74e.zip
opie-fb30e3e116d8616cb05b3765ae1aed5f7e96c74e.tar.gz
opie-fb30e3e116d8616cb05b3765ae1aed5f7e96c74e.tar.bz2
- last functions re-implemented
- small bugfix TODO: remove twice code within pop3/mh/mbox wrapper
Diffstat (limited to 'noncore/net') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 85f9cf0..5adba55 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -67,9 +67,9 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target )
return;
}
QString f = buildPath(mailbox);
- int r = mailsession_select_folder(m_storage->sto_session,(char*)mailbox.latin1());
+ int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
if (r!=MAIL_NO_ERROR) {
- qDebug("error selecting folder!");
+ qDebug("listMessages: error selecting folder!");
return;
}
parseList(target,m_storage->sto_session,f);
@@ -236,18 +236,21 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail)
void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target)
{
-#if 0
- QString p = MHPath+"/";
- p+=mailbox;
- mailmbox_folder*f = 0;
- int r = mailmbox_init(p.latin1(),0,1,0,&f);
- if (r != MAIL_NO_ERROR) {
- qDebug("Error init folder");
+ QString f = buildPath(mailbox);
+ int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
+ if (r!=MAIL_NO_ERROR) {
+ qDebug("deleteMails: error selecting folder!");
return;
}
- deleteMails(f,target);
- mailmbox_done(f);
-#endif
+ RecMail*c = 0;
+ for (unsigned int i=0; i < target.count();++i) {
+ c = target.at(i);
+ r = mailsession_remove_message(m_storage->sto_session,c->getNumber());
+ if (r != MAIL_NO_ERROR) {
+ qDebug("error deleting mail");
+ break;
+ }
+ }
}
int MHwrapper::deleteAllMail(const Folder*tfolder)