author | harlekin <harlekin> | 2004-02-29 21:55:06 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-02-29 21:55:06 (UTC) |
commit | dcf152e23f7cc85fe2e46521e07b64e2288efdda (patch) (unidiff) | |
tree | 8aac8095aed8dc9a9efab7005b8f1c53cce82536 /noncore/net/mail/libmailwrapper | |
parent | 225b92ec28bbe3a9368e8534323a3c335432e447 (diff) | |
download | opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.zip opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.tar.gz opie-dcf152e23f7cc85fe2e46521e07b64e2288efdda.tar.bz2 |
beginning of nntp stuff
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.cpp | 10 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/abstractmail.h | 1 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/libmailwrapper.pro | 6 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 241 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.h | 48 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 6 |
6 files changed, 305 insertions, 7 deletions
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.cpp b/noncore/net/mail/libmailwrapper/abstractmail.cpp index 592cd5e..741a8e1 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.cpp +++ b/noncore/net/mail/libmailwrapper/abstractmail.cpp | |||
@@ -1,9 +1,10 @@ | |||
1 | #include "abstractmail.h" | 1 | #include "abstractmail.h" |
2 | #include "imapwrapper.h" | 2 | #include "imapwrapper.h" |
3 | #include "pop3wrapper.h" | 3 | #include "pop3wrapper.h" |
4 | #include "nntpwrapper.h" | ||
4 | #include "mhwrapper.h" | 5 | #include "mhwrapper.h" |
5 | #include "mboxwrapper.h" | 6 | #include "mboxwrapper.h" |
6 | #include "mailtypes.h" | 7 | #include "mailtypes.h" |
7 | 8 | ||
8 | #include <qstring.h> | 9 | #include <qstring.h> |
9 | #include <qfile.h> | 10 | #include <qfile.h> |
@@ -19,12 +20,17 @@ AbstractMail* AbstractMail::getWrapper(IMAPaccount *a) | |||
19 | 20 | ||
20 | AbstractMail* AbstractMail::getWrapper(POP3account *a) | 21 | AbstractMail* AbstractMail::getWrapper(POP3account *a) |
21 | { | 22 | { |
22 | return new POP3wrapper(a); | 23 | return new POP3wrapper(a); |
23 | } | 24 | } |
24 | 25 | ||
26 | AbstractMail* AbstractMail::getWrapper(NNTPaccount *a) | ||
27 | { | ||
28 | return new NNTPwrapper(a); | ||
29 | } | ||
30 | |||
25 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) | 31 | AbstractMail* AbstractMail::getWrapper(const QString&a,const QString&name) |
26 | { | 32 | { |
27 | return new MHwrapper(a,name); | 33 | return new MHwrapper(a,name); |
28 | } | 34 | } |
29 | 35 | ||
30 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) | 36 | encodedString* AbstractMail::decode_String(const encodedString*text,const QString&enc) |
@@ -45,26 +51,26 @@ encodedString* AbstractMail::decode_String(const encodedString*text,const QStrin | |||
45 | } else if (enc.lower()=="binary") { | 51 | } else if (enc.lower()=="binary") { |
46 | mimetype = MAILMIME_MECHANISM_BINARY; | 52 | mimetype = MAILMIME_MECHANISM_BINARY; |
47 | } | 53 | } |
48 | 54 | ||
49 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, | 55 | int err = mailmime_part_parse(text->Content(),text->Length(),&index,mimetype, |
50 | &result_text,&target_length); | 56 | &result_text,&target_length); |
51 | 57 | ||
52 | encodedString* result = new encodedString(); | 58 | encodedString* result = new encodedString(); |
53 | if (err == MAILIMF_NO_ERROR) { | 59 | if (err == MAILIMF_NO_ERROR) { |
54 | result->setContent(result_text,target_length); | 60 | result->setContent(result_text,target_length); |
55 | } | 61 | } |
56 | qDebug("Decode string finished"); | 62 | qDebug("Decode string finished"); |
57 | return result; | 63 | return result; |
58 | } | 64 | } |
59 | 65 | ||
60 | QString AbstractMail::convert_String(const char*text) | 66 | QString AbstractMail::convert_String(const char*text) |
61 | { | 67 | { |
62 | size_t index = 0; | 68 | size_t index = 0; |
63 | char*res = 0; | 69 | char*res = 0; |
64 | 70 | ||
65 | /* attention - doesn't work with arm systems! */ | 71 | /* attention - doesn't work with arm systems! */ |
66 | int err = mailmime_encoded_phrase_parse("iso-8859-1", | 72 | int err = mailmime_encoded_phrase_parse("iso-8859-1", |
67 | text, strlen(text),&index, "iso-8859-1",&res); | 73 | text, strlen(text),&index, "iso-8859-1",&res); |
68 | if (err != MAILIMF_NO_ERROR) { | 74 | if (err != MAILIMF_NO_ERROR) { |
69 | if (res) free(res); | 75 | if (res) free(res); |
70 | return QString(text); | 76 | return QString(text); |
diff --git a/noncore/net/mail/libmailwrapper/abstractmail.h b/noncore/net/mail/libmailwrapper/abstractmail.h index f93bab4..b6e1538 100644 --- a/noncore/net/mail/libmailwrapper/abstractmail.h +++ b/noncore/net/mail/libmailwrapper/abstractmail.h | |||
@@ -46,12 +46,13 @@ public: | |||
46 | */ | 46 | */ |
47 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); | 47 | virtual int createMbox(const QString&,const Folder*parentfolder=0,const QString& delemiter="/",bool getsubfolder=false); |
48 | virtual void logout()=0; | 48 | virtual void logout()=0; |
49 | 49 | ||
50 | static AbstractMail* getWrapper(IMAPaccount *a); | 50 | static AbstractMail* getWrapper(IMAPaccount *a); |
51 | static AbstractMail* getWrapper(POP3account *a); | 51 | static AbstractMail* getWrapper(POP3account *a); |
52 | static AbstractMail* getWrapper(NNTPaccount *a); | ||
52 | /* mbox only! */ | 53 | /* mbox only! */ |
53 | static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); | 54 | static AbstractMail* getWrapper(const QString&a,const QString&name="Local Folders"); |
54 | 55 | ||
55 | static QString defaultLocalfolder(); | 56 | static QString defaultLocalfolder(); |
56 | 57 | ||
57 | virtual const QString&getType()const=0; | 58 | virtual const QString&getType()const=0; |
diff --git a/noncore/net/mail/libmailwrapper/libmailwrapper.pro b/noncore/net/mail/libmailwrapper/libmailwrapper.pro index 71f6cca..8ea04a4 100644 --- a/noncore/net/mail/libmailwrapper/libmailwrapper.pro +++ b/noncore/net/mail/libmailwrapper/libmailwrapper.pro | |||
@@ -10,13 +10,14 @@ HEADERS = mailwrapper.h \ | |||
10 | genericwrapper.h \ | 10 | genericwrapper.h \ |
11 | mboxwrapper.h \ | 11 | mboxwrapper.h \ |
12 | settings.h \ | 12 | settings.h \ |
13 | logindialog.h \ | 13 | logindialog.h \ |
14 | sendmailprogress.h \ | 14 | sendmailprogress.h \ |
15 | statusmail.h \ | 15 | statusmail.h \ |
16 | mhwrapper.h | 16 | mhwrapper.h \ |
17 | nntpwrapper.h | ||
17 | 18 | ||
18 | SOURCES = imapwrapper.cpp \ | 19 | SOURCES = imapwrapper.cpp \ |
19 | mailwrapper.cpp \ | 20 | mailwrapper.cpp \ |
20 | mailtypes.cpp \ | 21 | mailtypes.cpp \ |
21 | pop3wrapper.cpp \ | 22 | pop3wrapper.cpp \ |
22 | abstractmail.cpp \ | 23 | abstractmail.cpp \ |
@@ -24,13 +25,14 @@ SOURCES = imapwrapper.cpp \ | |||
24 | genericwrapper.cpp \ | 25 | genericwrapper.cpp \ |
25 | mboxwrapper.cpp \ | 26 | mboxwrapper.cpp \ |
26 | settings.cpp \ | 27 | settings.cpp \ |
27 | logindialog.cpp \ | 28 | logindialog.cpp \ |
28 | sendmailprogress.cpp \ | 29 | sendmailprogress.cpp \ |
29 | statusmail.cpp \ | 30 | statusmail.cpp \ |
30 | mhwrapper.cpp | 31 | mhwrapper.cpp \ |
32 | nntpwrapper.cpp | ||
31 | 33 | ||
32 | INTERFACES = logindialogui.ui \ | 34 | INTERFACES = logindialogui.ui \ |
33 | sendmailprogressui.ui | 35 | sendmailprogressui.ui |
34 | 36 | ||
35 | 37 | ||
36 | INCLUDEPATH += $(OPIEDIR)/include | 38 | INCLUDEPATH += $(OPIEDIR)/include |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp new file mode 100644 index 0000000..e73a890 --- a/dev/null +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -0,0 +1,241 @@ | |||
1 | #include "nntpwrapper.h" | ||
2 | #include "logindialog.h" | ||
3 | #include "mailtypes.h" | ||
4 | |||
5 | #include <qfile.h> | ||
6 | |||
7 | #include <stdlib.h> | ||
8 | |||
9 | #include <libetpan/libetpan.h> | ||
10 | #include <libetpan/nntpdriver.h> | ||
11 | |||
12 | |||
13 | |||
14 | #define HARD_MSG_SIZE_LIMIT 5242880 | ||
15 | |||
16 | NNTPwrapper::NNTPwrapper( NNTPaccount *a ) | ||
17 | : Genericwrapper() { | ||
18 | account = a; | ||
19 | m_nntp = NULL; | ||
20 | msgTempName = a->getFileName()+"_msg_cache"; | ||
21 | last_msg_id = 0; | ||
22 | } | ||
23 | |||
24 | NNTPwrapper::~NNTPwrapper() { | ||
25 | logout(); | ||
26 | QFile msg_cache(msgTempName); | ||
27 | if (msg_cache.exists()) { | ||
28 | msg_cache.remove(); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | void NNTPwrapper::nntp_progress( size_t current, size_t maximum ) { | ||
33 | qDebug( "NNTP: %i of %i", current, maximum ); | ||
34 | } | ||
35 | |||
36 | |||
37 | RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | ||
38 | int err = NEWSNNTP_NO_ERROR; | ||
39 | char *message = 0; | ||
40 | size_t length = 0; | ||
41 | |||
42 | login(); | ||
43 | if ( !m_nntp ) { | ||
44 | return RecBody(); | ||
45 | } | ||
46 | |||
47 | RecBody body; | ||
48 | mailmessage * mailmsg; | ||
49 | if (mail.Msgsize()>HARD_MSG_SIZE_LIMIT) { | ||
50 | qDebug("Message to large: %i",mail.Msgsize()); | ||
51 | return body; | ||
52 | } | ||
53 | |||
54 | QFile msg_cache(msgTempName); | ||
55 | |||
56 | cleanMimeCache(); | ||
57 | |||
58 | if (mail.getNumber()!=last_msg_id) { | ||
59 | if (msg_cache.exists()) { | ||
60 | msg_cache.remove(); | ||
61 | } | ||
62 | msg_cache.open(IO_ReadWrite|IO_Truncate); | ||
63 | last_msg_id = mail.getNumber(); | ||
64 | err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); | ||
65 | err = mailmessage_fetch(mailmsg,&message,&length); | ||
66 | msg_cache.writeBlock(message,length); | ||
67 | } else { | ||
68 | QString msg=""; | ||
69 | msg_cache.open(IO_ReadOnly); | ||
70 | message = new char[4096]; | ||
71 | memset(message,0,4096); | ||
72 | while (msg_cache.readBlock(message,4095)>0) { | ||
73 | msg+=message; | ||
74 | memset(message,0,4096); | ||
75 | } | ||
76 | delete message; | ||
77 | message = (char*)malloc(msg.length()+1*sizeof(char)); | ||
78 | memset(message,0,msg.length()+1); | ||
79 | memcpy(message,msg.latin1(),msg.length()); | ||
80 | /* transform to libetpan stuff */ | ||
81 | mailmsg = mailmessage_new(); | ||
82 | mailmessage_init(mailmsg, NULL, data_message_driver, 0, strlen(message)); | ||
83 | generic_message_t * msg_data; | ||
84 | msg_data = (generic_message_t *)mailmsg->msg_data; | ||
85 | msg_data->msg_fetched = 1; | ||
86 | msg_data->msg_message = message; | ||
87 | msg_data->msg_length = strlen(message); | ||
88 | } | ||
89 | body = parseMail(mailmsg); | ||
90 | |||
91 | /* clean up */ | ||
92 | if (mailmsg) | ||
93 | mailmessage_free(mailmsg); | ||
94 | if (message) | ||
95 | free(message); | ||
96 | |||
97 | return body; | ||
98 | } | ||
99 | |||
100 | |||
101 | void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target ) | ||
102 | { | ||
103 | login(); | ||
104 | if (!m_nntp) | ||
105 | return; | ||
106 | uint32_t res_messages,res_recent,res_unseen; | ||
107 | mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | ||
108 | parseList(target,m_nntp->sto_session,"INBOX"); | ||
109 | } | ||
110 | |||
111 | void NNTPwrapper::login() | ||
112 | { | ||
113 | if (account->getOffline()) | ||
114 | return; | ||
115 | /* we'll hold the line */ | ||
116 | if ( m_nntp != NULL ) | ||
117 | return; | ||
118 | |||
119 | const char *server, *user, *pass; | ||
120 | uint16_t port; | ||
121 | int err = NEWSNNTP_NO_ERROR; | ||
122 | |||
123 | server = account->getServer().latin1(); | ||
124 | port = account->getPort().toUInt(); | ||
125 | |||
126 | if ( account->getUser().isEmpty() || account->getPassword().isEmpty() ) { | ||
127 | LoginDialog login( account->getUser(), account->getPassword(), NULL, 0, true ); | ||
128 | login.show(); | ||
129 | if ( QDialog::Accepted == login.exec() ) { | ||
130 | // ok | ||
131 | user = login.getUser().latin1(); | ||
132 | pass = login.getPassword().latin1(); | ||
133 | } else { | ||
134 | // cancel | ||
135 | qDebug( "NNTP: Login canceled" ); | ||
136 | return; | ||
137 | } | ||
138 | } else { | ||
139 | user = account->getUser().latin1(); | ||
140 | pass = account->getPassword().latin1(); | ||
141 | } | ||
142 | |||
143 | // bool ssl = account->getSSL(); | ||
144 | |||
145 | m_nntp=mailstorage_new(NULL); | ||
146 | |||
147 | int conntypeset = account->ConnectionType(); | ||
148 | int conntype = 0; | ||
149 | if ( conntypeset == 3 ) { | ||
150 | conntype = CONNECTION_TYPE_COMMAND; | ||
151 | } else if ( conntypeset == 2 ) { | ||
152 | conntype = CONNECTION_TYPE_TLS; | ||
153 | } else if ( conntypeset == 1 ) { | ||
154 | conntype = CONNECTION_TYPE_STARTTLS; | ||
155 | } else if ( conntypeset == 0 ) { | ||
156 | conntype = CONNECTION_TYPE_TRY_STARTTLS; | ||
157 | } | ||
158 | |||
159 | nntp_mailstorage_init(m_nntp,(char*)server, port, NULL, conntype, NNTP_AUTH_TYPE_PLAIN, | ||
160 | (char*)user,(char*)pass,0,0,0); | ||
161 | |||
162 | err = mailstorage_connect(m_nntp); | ||
163 | |||
164 | if (err != NEWSNNTP_NO_ERROR) { | ||
165 | qDebug( QString( "FEHLERNUMMER %1" ).arg( err ) ); | ||
166 | // Global::statusMessage(tr("Error initializing folder")); | ||
167 | mailstorage_free(m_nntp); | ||
168 | m_nntp = 0; | ||
169 | } | ||
170 | } | ||
171 | |||
172 | void NNTPwrapper::logout() | ||
173 | { | ||
174 | int err = NEWSNNTP_NO_ERROR; | ||
175 | if ( m_nntp == NULL ) | ||
176 | return; | ||
177 | mailstorage_free(m_nntp); | ||
178 | m_nntp = 0; | ||
179 | } | ||
180 | |||
181 | QList<Folder>* NNTPwrapper::listFolders() { | ||
182 | QList<Folder> * folders = new QList<Folder>(); | ||
183 | folders->setAutoDelete( false ); | ||
184 | clist *result = 0; | ||
185 | |||
186 | // int err = | ||
187 | // if ( err == _NO_ERROR ) { | ||
188 | // current = result->first; | ||
189 | // for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) { | ||
190 | |||
191 | |||
192 | // Folder*inb=new Folder("INBOX","/"); | ||
193 | |||
194 | |||
195 | // folders->append(inb); | ||
196 | return folders; | ||
197 | } | ||
198 | |||
199 | |||
200 | void NNTPwrapper::answeredMail(const RecMail&) {} | ||
201 | |||
202 | void NNTPwrapper::statusFolder(folderStat&target_stat,const QString&) { | ||
203 | login(); | ||
204 | target_stat.message_count = 0; | ||
205 | target_stat.message_unseen = 0; | ||
206 | target_stat.message_recent = 0; | ||
207 | if (!m_nntp) | ||
208 | return; | ||
209 | int r = mailsession_status_folder(m_nntp->sto_session,0,&target_stat.message_count, | ||
210 | &target_stat.message_recent,&target_stat.message_unseen); | ||
211 | } | ||
212 | |||
213 | |||
214 | encodedString* NNTPwrapper::fetchRawBody(const RecMail&mail) { | ||
215 | char*target=0; | ||
216 | size_t length=0; | ||
217 | encodedString*res = 0; | ||
218 | mailmessage * mailmsg = 0; | ||
219 | int err = mailsession_get_message(m_nntp->sto_session, mail.getNumber(), &mailmsg); | ||
220 | err = mailmessage_fetch(mailmsg,&target,&length); | ||
221 | if (mailmsg) | ||
222 | mailmessage_free(mailmsg); | ||
223 | if (target) { | ||
224 | res = new encodedString(target,length); | ||
225 | } | ||
226 | return res; | ||
227 | } | ||
228 | |||
229 | const QString&NNTPwrapper::getType()const { | ||
230 | return account->getType(); | ||
231 | } | ||
232 | |||
233 | const QString&NNTPwrapper::getName()const{ | ||
234 | return account->getAccountName(); | ||
235 | } | ||
236 | |||
237 | void NNTPwrapper::deleteMail(const RecMail&mail) { | ||
238 | } | ||
239 | |||
240 | int NNTPwrapper::deleteAllMail(const Folder*) { | ||
241 | } | ||
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h new file mode 100644 index 0000000..e47e68f --- a/dev/null +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef __NNTPWRAPPER | ||
2 | #define __NNTPWRAPPER | ||
3 | |||
4 | #include "mailwrapper.h" | ||
5 | #include "genericwrapper.h" | ||
6 | #include <qstring.h> | ||
7 | #include <libetpan/clist.h> | ||
8 | |||
9 | class encodedString; | ||
10 | struct mailstorage; | ||
11 | struct mailfolder; | ||
12 | |||
13 | class NNTPwrapper : public Genericwrapper | ||
14 | { | ||
15 | |||
16 | Q_OBJECT | ||
17 | |||
18 | public: | ||
19 | NNTPwrapper( NNTPaccount *a ); | ||
20 | virtual ~NNTPwrapper(); | ||
21 | |||
22 | /* mailbox will be ignored */ | ||
23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | ||
24 | /* should only get the subscribed one */ | ||
25 | virtual QList<Folder>* listFolders(); | ||
26 | /* mailbox will be ignored */ | ||
27 | virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); | ||
28 | |||
29 | virtual void deleteMail(const RecMail&mail); | ||
30 | virtual void answeredMail(const RecMail&mail); | ||
31 | virtual int deleteAllMail(const Folder*); | ||
32 | |||
33 | virtual RecBody fetchBody( const RecMail &mail ); | ||
34 | virtual encodedString* fetchRawBody(const RecMail&mail); | ||
35 | virtual void logout(); | ||
36 | virtual const QString&getType()const; | ||
37 | virtual const QString&getName()const; | ||
38 | static void nntp_progress( size_t current, size_t maximum ); | ||
39 | |||
40 | protected: | ||
41 | void login(); | ||
42 | NNTPaccount *account; | ||
43 | mailstorage* m_nntp; | ||
44 | |||
45 | |||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 14c2059..6fab401 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -2,13 +2,13 @@ | |||
2 | #include "pop3wrapper.h" | 2 | #include "pop3wrapper.h" |
3 | #include "mailtypes.h" | 3 | #include "mailtypes.h" |
4 | #include "logindialog.h" | 4 | #include "logindialog.h" |
5 | #include <libetpan/libetpan.h> | 5 | #include <libetpan/libetpan.h> |
6 | #include <qpe/global.h> | 6 | #include <qpe/global.h> |
7 | #include <qfile.h> | 7 | #include <qfile.h> |
8 | #include <qstring.h> | 8 | //#include <qstring.h> |
9 | 9 | ||
10 | /* we don't fetch messages larger than 5 MB */ | 10 | /* we don't fetch messages larger than 5 MB */ |
11 | #define HARD_MSG_SIZE_LIMIT 5242880 | 11 | #define HARD_MSG_SIZE_LIMIT 5242880 |
12 | 12 | ||
13 | POP3wrapper::POP3wrapper( POP3account *a ) | 13 | POP3wrapper::POP3wrapper( POP3account *a ) |
14 | : Genericwrapper() { | 14 | : Genericwrapper() { |
@@ -90,13 +90,13 @@ RecBody POP3wrapper::fetchBody( const RecMail &mail ) { | |||
90 | if (message) | 90 | if (message) |
91 | free(message); | 91 | free(message); |
92 | 92 | ||
93 | return body; | 93 | return body; |
94 | } | 94 | } |
95 | 95 | ||
96 | void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | 96 | void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) |
97 | { | 97 | { |
98 | login(); | 98 | login(); |
99 | if (!m_pop3) | 99 | if (!m_pop3) |
100 | return; | 100 | return; |
101 | uint32_t res_messages,res_recent,res_unseen; | 101 | uint32_t res_messages,res_recent,res_unseen; |
102 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 102 | mailsession_status_folder(m_pop3->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); |
@@ -164,13 +164,13 @@ void POP3wrapper::login() | |||
164 | Global::statusMessage(tr("Error initializing folder")); | 164 | Global::statusMessage(tr("Error initializing folder")); |
165 | mailstorage_free(m_pop3); | 165 | mailstorage_free(m_pop3); |
166 | m_pop3 = 0; | 166 | m_pop3 = 0; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | void POP3wrapper::logout() | 170 | void POP3wrapper::logout() |
171 | { | 171 | { |
172 | int err = MAILPOP3_NO_ERROR; | 172 | int err = MAILPOP3_NO_ERROR; |
173 | if ( m_pop3 == NULL ) | 173 | if ( m_pop3 == NULL ) |
174 | return; | 174 | return; |
175 | mailstorage_free(m_pop3); | 175 | mailstorage_free(m_pop3); |
176 | m_pop3 = 0; | 176 | m_pop3 = 0; |