author | alwin <alwin> | 2003-12-13 22:35:35 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-13 22:35:35 (UTC) |
commit | b0a71314013a3367767526b68928a7168b4ad460 (patch) (unidiff) | |
tree | 9f223458a7f029fad43f7db126b527ad49d60ce4 | |
parent | f1fa9ca873169e803fcc28cecd756a3edaa30ec4 (diff) | |
download | opie-b0a71314013a3367767526b68928a7168b4ad460.zip opie-b0a71314013a3367767526b68928a7168b4ad460.tar.gz opie-b0a71314013a3367767526b68928a7168b4ad460.tar.bz2 |
deleting a mail in a imap server implemented
-rw-r--r-- | noncore/net/mail/abstractmail.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.cpp | 32 | ||||
-rw-r--r-- | noncore/net/mail/imapwrapper.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 32 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.h | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.h | 2 |
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 | |||
@@ -7,24 +7,24 @@ | |||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | class RecPart; | 9 | class RecPart; |
10 | class IMAPwrapper; | 10 | class IMAPwrapper; |
11 | class POP3wrapper; | 11 | class POP3wrapper; |
12 | class Folder; | 12 | class Folder; |
13 | 13 | ||
14 | class AbstractMail:public QObject | 14 | class AbstractMail:public QObject |
15 | { | 15 | { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | public: | 17 | public: |
18 | AbstractMail(){}; | 18 | AbstractMail(){}; |
19 | virtual ~AbstractMail(){} | 19 | virtual ~AbstractMail(){} |
20 | virtual QList<Folder>* listFolders()=0; | 20 | virtual QList<Folder>* listFolders()=0; |
21 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 21 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
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 | ||
26 | static AbstractMail* getWrapper(IMAPaccount *a); | 26 | static AbstractMail* getWrapper(IMAPaccount *a); |
27 | static AbstractMail* getWrapper(POP3account *a); | 27 | static AbstractMail* getWrapper(POP3account *a); |
28 | }; | 28 | }; |
29 | 29 | ||
30 | #endif | 30 | #endif |
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 | |||
@@ -683,16 +683,48 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
683 | default: | 683 | default: |
684 | if (enc->enc_value) { | 684 | if (enc->enc_value) { |
685 | char*t=enc->enc_value; | 685 | char*t=enc->enc_value; |
686 | encoding=QString(enc->enc_value); | 686 | encoding=QString(enc->enc_value); |
687 | enc->enc_value=0L; | 687 | enc->enc_value=0L; |
688 | free(t); | 688 | free(t); |
689 | } | 689 | } |
690 | } | 690 | } |
691 | target_part.setEncoding(encoding); | 691 | target_part.setEncoding(encoding); |
692 | target_part.setSize(which->bd_size); | 692 | target_part.setSize(which->bd_size); |
693 | } | 693 | } |
694 | 694 | ||
695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) | 695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) |
696 | { | 696 | { |
697 | return fetchPart(mail,part.Positionlist(),false); | 697 | return fetchPart(mail,part.Positionlist(),false); |
698 | } | 698 | } |
699 | |||
700 | void 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 | |||
@@ -10,40 +10,43 @@ struct mailimap_body_type_1part; | |||
10 | struct mailimap_body_type_text; | 10 | struct mailimap_body_type_text; |
11 | struct mailimap_body_type_basic; | 11 | struct mailimap_body_type_basic; |
12 | struct mailimap_body_type_msg; | 12 | struct mailimap_body_type_msg; |
13 | struct mailimap_body_type_mpart; | 13 | struct mailimap_body_type_mpart; |
14 | struct mailimap_body_fields; | 14 | struct mailimap_body_fields; |
15 | struct mailimap_msg_att; | 15 | struct mailimap_msg_att; |
16 | 16 | ||
17 | class IMAPwrapper : public AbstractMail | 17 | class IMAPwrapper : public AbstractMail |
18 | { | 18 | { |
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | public: | 20 | public: |
21 | IMAPwrapper( IMAPaccount *a ); | 21 | IMAPwrapper( IMAPaccount *a ); |
22 | virtual ~IMAPwrapper(); | 22 | virtual ~IMAPwrapper(); |
23 | virtual QList<Folder>* listFolders(); | 23 | virtual QList<Folder>* listFolders(); |
24 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 24 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
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 ); |
29 | 30 | ||
30 | protected: | 31 | protected: |
31 | RecMail*parse_list_result(mailimap_msg_att*); | 32 | RecMail*parse_list_result(mailimap_msg_att*); |
32 | void login(); | 33 | void login(); |
33 | void logout(); | 34 | void logout(); |
35 | |||
36 | virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false); | ||
34 | 37 | ||
35 | void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body); | 38 | void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body); |
36 | void searchBodyText(const RecMail&mail,mailimap_body_type_mpart*mailDescription,RecBody&target_body,int current_recursion=0,QValueList<int>recList=QValueList<int>()); | 39 | void searchBodyText(const RecMail&mail,mailimap_body_type_mpart*mailDescription,RecBody&target_body,int current_recursion=0,QValueList<int>recList=QValueList<int>()); |
37 | 40 | ||
38 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); | 41 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); |
39 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); | 42 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); |
40 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); | 43 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); |
41 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); | 44 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); |
42 | 45 | ||
43 | /* just helpers */ | 46 | /* just helpers */ |
44 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); | 47 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); |
45 | static QStringList address_list_to_stringlist(clist*list); | 48 | static QStringList address_list_to_stringlist(clist*list); |
46 | 49 | ||
47 | private: | 50 | private: |
48 | IMAPaccount *account; | 51 | IMAPaccount *account; |
49 | mailimap *m_imap; | 52 | mailimap *m_imap; |
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 | |||
@@ -7,24 +7,24 @@ | |||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | class RecPart; | 9 | class RecPart; |
10 | class IMAPwrapper; | 10 | class IMAPwrapper; |
11 | class POP3wrapper; | 11 | class POP3wrapper; |
12 | class Folder; | 12 | class Folder; |
13 | 13 | ||
14 | class AbstractMail:public QObject | 14 | class AbstractMail:public QObject |
15 | { | 15 | { |
16 | Q_OBJECT | 16 | Q_OBJECT |
17 | public: | 17 | public: |
18 | AbstractMail(){}; | 18 | AbstractMail(){}; |
19 | virtual ~AbstractMail(){} | 19 | virtual ~AbstractMail(){} |
20 | virtual QList<Folder>* listFolders()=0; | 20 | virtual QList<Folder>* listFolders()=0; |
21 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; | 21 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target )=0; |
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 | ||
26 | static AbstractMail* getWrapper(IMAPaccount *a); | 26 | static AbstractMail* getWrapper(IMAPaccount *a); |
27 | static AbstractMail* getWrapper(POP3account *a); | 27 | static AbstractMail* getWrapper(POP3account *a); |
28 | }; | 28 | }; |
29 | 29 | ||
30 | #endif | 30 | #endif |
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 | |||
@@ -683,16 +683,48 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
683 | default: | 683 | default: |
684 | if (enc->enc_value) { | 684 | if (enc->enc_value) { |
685 | char*t=enc->enc_value; | 685 | char*t=enc->enc_value; |
686 | encoding=QString(enc->enc_value); | 686 | encoding=QString(enc->enc_value); |
687 | enc->enc_value=0L; | 687 | enc->enc_value=0L; |
688 | free(t); | 688 | free(t); |
689 | } | 689 | } |
690 | } | 690 | } |
691 | target_part.setEncoding(encoding); | 691 | target_part.setEncoding(encoding); |
692 | target_part.setSize(which->bd_size); | 692 | target_part.setSize(which->bd_size); |
693 | } | 693 | } |
694 | 694 | ||
695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) | 695 | QString IMAPwrapper::fetchPart(const RecMail&mail,const RecPart&part) |
696 | { | 696 | { |
697 | return fetchPart(mail,part.Positionlist(),false); | 697 | return fetchPart(mail,part.Positionlist(),false); |
698 | } | 698 | } |
699 | |||
700 | void 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 | |||
@@ -10,40 +10,43 @@ struct mailimap_body_type_1part; | |||
10 | struct mailimap_body_type_text; | 10 | struct mailimap_body_type_text; |
11 | struct mailimap_body_type_basic; | 11 | struct mailimap_body_type_basic; |
12 | struct mailimap_body_type_msg; | 12 | struct mailimap_body_type_msg; |
13 | struct mailimap_body_type_mpart; | 13 | struct mailimap_body_type_mpart; |
14 | struct mailimap_body_fields; | 14 | struct mailimap_body_fields; |
15 | struct mailimap_msg_att; | 15 | struct mailimap_msg_att; |
16 | 16 | ||
17 | class IMAPwrapper : public AbstractMail | 17 | class IMAPwrapper : public AbstractMail |
18 | { | 18 | { |
19 | Q_OBJECT | 19 | Q_OBJECT |
20 | public: | 20 | public: |
21 | IMAPwrapper( IMAPaccount *a ); | 21 | IMAPwrapper( IMAPaccount *a ); |
22 | virtual ~IMAPwrapper(); | 22 | virtual ~IMAPwrapper(); |
23 | virtual QList<Folder>* listFolders(); | 23 | virtual QList<Folder>* listFolders(); |
24 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); | 24 | virtual void listMessages(const QString & mailbox,QList<RecMail>&target ); |
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 ); |
29 | 30 | ||
30 | protected: | 31 | protected: |
31 | RecMail*parse_list_result(mailimap_msg_att*); | 32 | RecMail*parse_list_result(mailimap_msg_att*); |
32 | void login(); | 33 | void login(); |
33 | void logout(); | 34 | void logout(); |
35 | |||
36 | virtual QString fetchPart(const RecMail&mail,const QValueList<int>&path,bool internal_call=false); | ||
34 | 37 | ||
35 | void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body); | 38 | void searchBodyText(const RecMail&mail,mailimap_body_type_1part*mailDescription,RecBody&target_body); |
36 | void searchBodyText(const RecMail&mail,mailimap_body_type_mpart*mailDescription,RecBody&target_body,int current_recursion=0,QValueList<int>recList=QValueList<int>()); | 39 | void searchBodyText(const RecMail&mail,mailimap_body_type_mpart*mailDescription,RecBody&target_body,int current_recursion=0,QValueList<int>recList=QValueList<int>()); |
37 | 40 | ||
38 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); | 41 | void fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description); |
39 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); | 42 | void fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which); |
40 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); | 43 | void fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which); |
41 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); | 44 | void fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which); |
42 | 45 | ||
43 | /* just helpers */ | 46 | /* just helpers */ |
44 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); | 47 | static void fillBodyFields(RecPart&target_part,mailimap_body_fields*which); |
45 | static QStringList address_list_to_stringlist(clist*list); | 48 | static QStringList address_list_to_stringlist(clist*list); |
46 | 49 | ||
47 | private: | 50 | private: |
48 | IMAPaccount *account; | 51 | IMAPaccount *account; |
49 | mailimap *m_imap; | 52 | mailimap *m_imap; |
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 | |||
@@ -266,25 +266,24 @@ void POP3wrapper::logout() | |||
266 | if ( m_pop3 == NULL ) return; | 266 | if ( m_pop3 == NULL ) return; |
267 | err = mailpop3_quit( m_pop3 ); | 267 | err = mailpop3_quit( m_pop3 ); |
268 | mailpop3_free( m_pop3 ); | 268 | mailpop3_free( m_pop3 ); |
269 | m_pop3 = NULL; | 269 | m_pop3 = NULL; |
270 | } | 270 | } |
271 | 271 | ||
272 | 272 | ||
273 | QList<Folder>* POP3wrapper::listFolders() | 273 | QList<Folder>* POP3wrapper::listFolders() |
274 | { | 274 | { |
275 | QList<Folder> * folders = new QList<Folder>(); | 275 | QList<Folder> * folders = new QList<Folder>(); |
276 | folders->setAutoDelete( true ); | 276 | folders->setAutoDelete( true ); |
277 | Folder*inb=new Folder("INBOX"); | 277 | Folder*inb=new Folder("INBOX"); |
278 | folders->append(inb); | 278 | folders->append(inb); |
279 | return folders; | 279 | return folders; |
280 | } | 280 | } |
281 | 281 | ||
282 | QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool) | 282 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) |
283 | { | 283 | { |
284 | return ""; | 284 | return ""; |
285 | } | 285 | } |
286 | 286 | ||
287 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) | 287 | void 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 | |||
@@ -5,34 +5,34 @@ | |||
5 | #include "abstractmail.h" | 5 | #include "abstractmail.h" |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | struct mailpop3; | 9 | struct mailpop3; |
10 | 10 | ||
11 | class POP3wrapper : public AbstractMail | 11 | class POP3wrapper : public AbstractMail |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | 14 | ||
15 | public: | 15 | public: |
16 | POP3wrapper( POP3account *a ); | 16 | POP3wrapper( POP3account *a ); |
17 | virtual ~POP3wrapper(); | 17 | virtual ~POP3wrapper(); |
18 | /* mailbox will be ignored */ | 18 | /* mailbox will be ignored */ |
19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
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 | ||
24 | RecBody fetchBody( const RecMail &mail ); | 24 | RecBody fetchBody( const RecMail &mail ); |
25 | static void pop3_progress( size_t current, size_t maximum ); | 25 | static void pop3_progress( size_t current, size_t maximum ); |
26 | 26 | ||
27 | protected: | 27 | protected: |
28 | void login(); | 28 | void login(); |
29 | void logout(); | 29 | void logout(); |
30 | 30 | ||
31 | private: | 31 | private: |
32 | RecMail *parseHeader( const char *header ); | 32 | RecMail *parseHeader( const char *header ); |
33 | RecBody parseBody( const char *message ); | 33 | RecBody parseBody( const char *message ); |
34 | QString parseMailboxList( mailimf_mailbox_list *list ); | 34 | QString parseMailboxList( mailimf_mailbox_list *list ); |
35 | QString parseMailbox( mailimf_mailbox *box ); | 35 | QString parseMailbox( mailimf_mailbox *box ); |
36 | QString parseGroup( mailimf_group *group ); | 36 | QString parseGroup( mailimf_group *group ); |
37 | QString parseAddressList( mailimf_address_list *list ); | 37 | QString parseAddressList( mailimf_address_list *list ); |
38 | QString parseDateTime( mailimf_date_time *date ); | 38 | QString parseDateTime( mailimf_date_time *date ); |
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 | |||
@@ -266,25 +266,24 @@ void POP3wrapper::logout() | |||
266 | if ( m_pop3 == NULL ) return; | 266 | if ( m_pop3 == NULL ) return; |
267 | err = mailpop3_quit( m_pop3 ); | 267 | err = mailpop3_quit( m_pop3 ); |
268 | mailpop3_free( m_pop3 ); | 268 | mailpop3_free( m_pop3 ); |
269 | m_pop3 = NULL; | 269 | m_pop3 = NULL; |
270 | } | 270 | } |
271 | 271 | ||
272 | 272 | ||
273 | QList<Folder>* POP3wrapper::listFolders() | 273 | QList<Folder>* POP3wrapper::listFolders() |
274 | { | 274 | { |
275 | QList<Folder> * folders = new QList<Folder>(); | 275 | QList<Folder> * folders = new QList<Folder>(); |
276 | folders->setAutoDelete( true ); | 276 | folders->setAutoDelete( true ); |
277 | Folder*inb=new Folder("INBOX"); | 277 | Folder*inb=new Folder("INBOX"); |
278 | folders->append(inb); | 278 | folders->append(inb); |
279 | return folders; | 279 | return folders; |
280 | } | 280 | } |
281 | 281 | ||
282 | QString POP3wrapper::fetchPart(const RecMail&,const QValueList<int>&,bool) | 282 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) |
283 | { | 283 | { |
284 | return ""; | 284 | return ""; |
285 | } | 285 | } |
286 | 286 | ||
287 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) | 287 | void 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 | |||
@@ -5,34 +5,34 @@ | |||
5 | #include "abstractmail.h" | 5 | #include "abstractmail.h" |
6 | 6 | ||
7 | class RecMail; | 7 | class RecMail; |
8 | class RecBody; | 8 | class RecBody; |
9 | struct mailpop3; | 9 | struct mailpop3; |
10 | 10 | ||
11 | class POP3wrapper : public AbstractMail | 11 | class POP3wrapper : public AbstractMail |
12 | { | 12 | { |
13 | Q_OBJECT | 13 | Q_OBJECT |
14 | 14 | ||
15 | public: | 15 | public: |
16 | POP3wrapper( POP3account *a ); | 16 | POP3wrapper( POP3account *a ); |
17 | virtual ~POP3wrapper(); | 17 | virtual ~POP3wrapper(); |
18 | /* mailbox will be ignored */ | 18 | /* mailbox will be ignored */ |
19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 19 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
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 | ||
24 | RecBody fetchBody( const RecMail &mail ); | 24 | RecBody fetchBody( const RecMail &mail ); |
25 | static void pop3_progress( size_t current, size_t maximum ); | 25 | static void pop3_progress( size_t current, size_t maximum ); |
26 | 26 | ||
27 | protected: | 27 | protected: |
28 | void login(); | 28 | void login(); |
29 | void logout(); | 29 | void logout(); |
30 | 30 | ||
31 | private: | 31 | private: |
32 | RecMail *parseHeader( const char *header ); | 32 | RecMail *parseHeader( const char *header ); |
33 | RecBody parseBody( const char *message ); | 33 | RecBody parseBody( const char *message ); |
34 | QString parseMailboxList( mailimf_mailbox_list *list ); | 34 | QString parseMailboxList( mailimf_mailbox_list *list ); |
35 | QString parseMailbox( mailimf_mailbox *box ); | 35 | QString parseMailbox( mailimf_mailbox *box ); |
36 | QString parseGroup( mailimf_group *group ); | 36 | QString parseGroup( mailimf_group *group ); |
37 | QString parseAddressList( mailimf_address_list *list ); | 37 | QString parseAddressList( mailimf_address_list *list ); |
38 | QString parseDateTime( mailimf_date_time *date ); | 38 | QString parseDateTime( mailimf_date_time *date ); |