summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/nntpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index c0b3eec..9de958d 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -2,24 +2,25 @@
2#include "logindialog.h" 2#include "logindialog.h"
3#include "mailtypes.h" 3#include "mailtypes.h"
4 4
5#include <qfile.h> 5#include <qfile.h>
6 6
7#include <stdlib.h> 7#include <stdlib.h>
8 8
9#include <libetpan/libetpan.h> 9#include <libetpan/libetpan.h>
10 10
11 11
12#define HARD_MSG_SIZE_LIMIT 5242880 12#define HARD_MSG_SIZE_LIMIT 5242880
13 13
14using namespace Opie::Core;
14NNTPwrapper::NNTPwrapper( NNTPaccount *a ) 15NNTPwrapper::NNTPwrapper( NNTPaccount *a )
15: Genericwrapper() { 16: Genericwrapper() {
16 account = a; 17 account = a;
17 m_nntp = NULL; 18 m_nntp = NULL;
18 msgTempName = a->getFileName()+"_msg_cache"; 19 msgTempName = a->getFileName()+"_msg_cache";
19 last_msg_id = 0; 20 last_msg_id = 0;
20} 21}
21 22
22NNTPwrapper::~NNTPwrapper() { 23NNTPwrapper::~NNTPwrapper() {
23 logout(); 24 logout();
24 QFile msg_cache(msgTempName); 25 QFile msg_cache(msgTempName);
25 if (msg_cache.exists()) { 26 if (msg_cache.exists()) {
@@ -87,25 +88,25 @@ RecBody NNTPwrapper::fetchBody( const RecMailP &mail ) {
87 body = parseMail(mailmsg); 88 body = parseMail(mailmsg);
88 89
89 /* clean up */ 90 /* clean up */
90 if (mailmsg) 91 if (mailmsg)
91 mailmessage_free(mailmsg); 92 mailmessage_free(mailmsg);
92 if (message) 93 if (message)
93 free(message); 94 free(message);
94 95
95 return body; 96 return body;
96} 97}
97 98
98 99
99void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::OSmartPointer<RecMail> > &target ) 100void NNTPwrapper::listMessages(const QString & which, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
100{ 101{
101 login(); 102 login();
102 if (!m_nntp) 103 if (!m_nntp)
103 return; 104 return;
104 uint32_t res_messages,res_recent,res_unseen; 105 uint32_t res_messages,res_recent,res_unseen;
105 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); 106 mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen);
106 parseList(target,m_nntp->sto_session,which,true); 107 parseList(target,m_nntp->sto_session,which,true);
107} 108}
108 109
109void NNTPwrapper::login() 110void NNTPwrapper::login()
110{ 111{
111 if (account->getOffline()) 112 if (account->getOffline())
@@ -179,27 +180,27 @@ void NNTPwrapper::login()
179 180
180} 181}
181 182
182void NNTPwrapper::logout() 183void NNTPwrapper::logout()
183{ 184{
184 int err = NEWSNNTP_NO_ERROR; 185 int err = NEWSNNTP_NO_ERROR;
185 if ( m_nntp == NULL ) 186 if ( m_nntp == NULL )
186 return; 187 return;
187 mailstorage_free(m_nntp); 188 mailstorage_free(m_nntp);
188 m_nntp = 0; 189 m_nntp = 0;
189} 190}
190 191
191QValueList<Opie::OSmartPointer<Folder> >* NNTPwrapper::listFolders() { 192QValueList<Opie::Core::OSmartPointer<Folder> >* NNTPwrapper::listFolders() {
192 193
193 QValueList<Opie::OSmartPointer<Folder> >* folders = new QValueList<Opie::OSmartPointer<Folder> >(); 194 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
194 QStringList groups; 195 QStringList groups;
195 if (account) { 196 if (account) {
196 groups = account->getGroups(); 197 groups = account->getGroups();
197 } 198 }
198 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { 199 for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) {
199 folders->append(new Folder((*it),".")); 200 folders->append(new Folder((*it),"."));
200 } 201 }
201 return folders; 202 return folders;
202} 203}
203 204
204/* we made this method in raw nntp access of etpan and not via generic interface 205/* we made this method in raw nntp access of etpan and not via generic interface
205 * 'cause in that case there will be doubled copy operations. eg. the etpan would 206 * 'cause in that case there will be doubled copy operations. eg. the etpan would