summaryrefslogtreecommitdiff
authoralwin <alwin>2003-12-13 22:35:35 (UTC)
committer alwin <alwin>2003-12-13 22:35:35 (UTC)
commitb0a71314013a3367767526b68928a7168b4ad460 (patch) (unidiff)
tree9f223458a7f029fad43f7db126b527ad49d60ce4
parentf1fa9ca873169e803fcc28cecd756a3edaa30ec4 (diff)
downloadopie-b0a71314013a3367767526b68928a7168b4ad460.zip
opie-b0a71314013a3367767526b68928a7168b4ad460.tar.gz
opie-b0a71314013a3367767526b68928a7168b4ad460.tar.bz2
deleting a mail in a imap server implemented
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/abstractmail.h2
-rw-r--r--noncore/net/mail/imapwrapper.cpp32
-rw-r--r--noncore/net/mail/imapwrapper.h5
-rw-r--r--noncore/net/mail/libmailwrapper/abstractmail.h2
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp32
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.h5
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp5
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.h2
-rw-r--r--noncore/net/mail/pop3wrapper.cpp5
-rw-r--r--noncore/net/mail/pop3wrapper.h2
10 files changed, 80 insertions, 12 deletions
diff --git a/noncore/net/mail/abstractmail.h b/noncore/net/mail/abstractmail.h
index bc8938f..0a1719d 100644
--- a/noncore/net/mail/abstractmail.h
+++ b/noncore/net/mail/abstractmail.h
@@ -22,4 +22,4 @@ public:
22 virtual RecBody fetchBody(const RecMail&mail)=0; 22 virtual RecBody fetchBody(const RecMail&mail)=0;
23 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false)=0;
24 virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0; 23 virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0;
24 virtual void deleteMail(const RecMail&mail)=0;
25 25
diff --git a/noncore/net/mail/imapwrapper.cpp b/noncore/net/mail/imapwrapper.cpp
index 3222c7e..a01a2a9 100644
--- a/noncore/net/mail/imapwrapper.cpp
+++ b/noncore/net/mail/imapwrapper.cpp
@@ -698 +698,33 @@ QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part)
698} 698}
699
700void IMAPwrapper::deleteMail(const RecMail&mail)
701{
702 mailimap_flag_list*flist;
703 mailimap_set *set;
704 mailimap_store_att_flags * store_flags;
705 int err;
706 login();
707 if (!m_imap) {
708 return;
709 }
710 const char *mb = mail.getMbox().latin1();
711 err = mailimap_select( m_imap, (char*)mb);
712 if ( err != MAILIMAP_NO_ERROR ) {
713 qDebug("error selecting mailbox for delete: %s",m_imap->imap_response);
714 return;
715 }
716 flist = mailimap_flag_list_new_empty();
717 mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
718 store_flags = mailimap_store_att_flags_new_set_flags(flist);
719 set = mailimap_set_new_single(mail.getNumber());
720 err = mailimap_store(m_imap,set,store_flags);
721 if (err != MAILIMAP_NO_ERROR) {
722 qDebug("error deleting mail: %s",m_imap->imap_response);
723 return;
724 }
725 err = mailimap_expunge(m_imap);
726 if (err != MAILIMAP_NO_ERROR) {
727 qDebug("error deleting mail: %s",m_imap->imap_response);
728 }
729 qDebug("Delete successfull");
730}
diff --git a/noncore/net/mail/imapwrapper.h b/noncore/net/mail/imapwrapper.h
index f88457a..4f4d575 100644
--- a/noncore/net/mail/imapwrapper.h
+++ b/noncore/net/mail/imapwrapper.h
@@ -25,4 +25,5 @@ public:
25 virtual RecBody fetchBody(const RecMail&mail); 25 virtual RecBody fetchBody(const RecMail&mail);
26 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
27 virtual QString fetchPart(const RecMail&mail,const RecPart&part); 26 virtual QString fetchPart(const RecMail&mail,const RecPart&part);
27 virtual void deleteMail(const RecMail&mail);
28
28 static void imap_progress( size_t current, size_t maximum ); 29 static void imap_progress( size_t current, size_t maximum );
@@ -33,2 +34,4 @@ protected:
33 void logout(); 34 void logout();
35
36 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
34 37
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h
index bc8938f..0a1719d 100644
--- a/noncore/net/mail/libmailwrapper/abstractmail.h
+++ b/noncore/net/mail/libmailwrapper/abstractmail.h
@@ -22,4 +22,4 @@ public:
22 virtual RecBody fetchBody(const RecMail&mail)=0; 22 virtual RecBody fetchBody(const RecMail&mail)=0;
23 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false)=0;
24 virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0; 23 virtual QString fetchPart(const RecMail&mail,const RecPart&part)=0;
24 virtual void deleteMail(const RecMail&mail)=0;
25 25
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 3222c7e..a01a2a9 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -698 +698,33 @@ QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part)
698} 698}
699
700void IMAPwrapper::deleteMail(const RecMail&mail)
701{
702 mailimap_flag_list*flist;
703 mailimap_set *set;
704 mailimap_store_att_flags * store_flags;
705 int err;
706 login();
707 if (!m_imap) {
708 return;
709 }
710 const char *mb = mail.getMbox().latin1();
711 err = mailimap_select( m_imap, (char*)mb);
712 if ( err != MAILIMAP_NO_ERROR ) {
713 qDebug("error selecting mailbox for delete: %s",m_imap->imap_response);
714 return;
715 }
716 flist = mailimap_flag_list_new_empty();
717 mailimap_flag_list_add(flist,mailimap_flag_new_deleted());
718 store_flags = mailimap_store_att_flags_new_set_flags(flist);
719 set = mailimap_set_new_single(mail.getNumber());
720 err = mailimap_store(m_imap,set,store_flags);
721 if (err != MAILIMAP_NO_ERROR) {
722 qDebug("error deleting mail: %s",m_imap->imap_response);
723 return;
724 }
725 err = mailimap_expunge(m_imap);
726 if (err != MAILIMAP_NO_ERROR) {
727 qDebug("error deleting mail: %s",m_imap->imap_response);
728 }
729 qDebug("Delete successfull");
730}
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.h b/noncore/net/mail/libmailwrapper/imapwrapper.h
index f88457a..4f4d575 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.h
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.h
@@ -25,4 +25,5 @@ public:
25 virtual RecBody fetchBody(const RecMail&mail); 25 virtual RecBody fetchBody(const RecMail&mail);
26 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
27 virtual QString fetchPart(const RecMail&mail,const RecPart&part); 26 virtual QString fetchPart(const RecMail&mail,const RecPart&part);
27 virtual void deleteMail(const RecMail&mail);
28
28 static void imap_progress( size_t current, size_t maximum ); 29 static void imap_progress( size_t current, size_t maximum );
@@ -33,2 +34,4 @@ protected:
33 void logout(); 34 void logout();
35
36 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
34 37
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 903ef4d..62523bf 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -281,3 +281,3 @@ QList<Folder>* POP3wrapper::listFolders()
281 281
282QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool) 282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
283{ 283{
@@ -286,5 +286,4 @@ QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool)
286 286
287QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) 287void POP3wrapper::deleteMail(const RecMail&)
288{ 288{
289 return "";
290} 289}
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h
index 3b24564..ef972c8 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.h
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h
@@ -20,4 +20,4 @@ public:
20 virtual QList<Folder>* listFolders(); 20 virtual QList<Folder>* listFolders();
21 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
22 virtual QString fetchPart(const RecMail&mail,const RecPart&part); 21 virtual QString fetchPart(const RecMail&mail,const RecPart&part);
22 virtual void deleteMail(const RecMail&mail);
23 23
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp
index 903ef4d..62523bf 100644
--- a/noncore/net/mail/pop3wrapper.cpp
+++ b/noncore/net/mail/pop3wrapper.cpp
@@ -281,3 +281,3 @@ QList<Folder>* POP3wrapper::listFolders()
281 281
282QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool) 282QString POP3wrapper::fetchPart(const RecMail&,const RecPart&)
283{ 283{
@@ -286,5 +286,4 @@ QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool)
286 286
287QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) 287void POP3wrapper::deleteMail(const RecMail&)
288{ 288{
289 return "";
290} 289}
diff --git a/noncore/net/mail/pop3wrapper.h b/noncore/net/mail/pop3wrapper.h
index 3b24564..ef972c8 100644
--- a/noncore/net/mail/pop3wrapper.h
+++ b/noncore/net/mail/pop3wrapper.h
@@ -20,4 +20,4 @@ public:
20 virtual QList<Folder>* listFolders(); 20 virtual QList<Folder>* listFolders();
21 virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false);
22 virtual QString fetchPart(const RecMail&mail,const RecPart&part); 21 virtual QString fetchPart(const RecMail&mail,const RecPart&part);
22 virtual void deleteMail(const RecMail&mail);
23 23