summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp19
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.h2
2 files changed, 17 insertions, 4 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index a766a59..5a8c224 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -203,5 +203,11 @@ QList<Folder>* NNTPwrapper::listFolders() {
203} 203}
204 204
205QStringList NNTPwrapper::listAllNewsgroups() { 205/* we made this method in raw nntp access of etpan and not via generic interface
206 * 'cause in that case there will be doubled copy operations. eg. the etpan would
207 * copy that stuff into its own structures and we must copy it into useable c++
208 * structures for our frontend. this would not make sense, so it is better to reimplement
209 * the stuff from generic interface of etpan but copy it direct to qt classes.
210 */
211QStringList NNTPwrapper::listAllNewsgroups(const QString&mask) {
206 login(); 212 login();
207 QStringList res; 213 QStringList res;
@@ -213,5 +219,12 @@ QStringList NNTPwrapper::listAllNewsgroups() {
213 mailsession * session = m_nntp->sto_session; 219 mailsession * session = m_nntp->sto_session;
214 newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session; 220 newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session;
215 int err = newsnntp_list_newsgroups(news, NULL, &result); 221 int err = NEWSNNTP_NO_ERROR;
222 if (mask.isEmpty()) {
223 err = newsnntp_list(news, &result);
224 } else {
225 /* taken from generic wrapper of etpan */
226 QString nmask = mask+".*";
227 err = newsnntp_list_active(news, nmask.latin1(), &result);
228 }
216 if ( err == NEWSNNTP_NO_ERROR && result) { 229 if ( err == NEWSNNTP_NO_ERROR && result) {
217 for ( current=clist_begin(result);current!=NULL;current=clist_next(current) ) { 230 for ( current=clist_begin(result);current!=NULL;current=clist_next(current) ) {
@@ -223,5 +236,5 @@ QStringList NNTPwrapper::listAllNewsgroups() {
223 } 236 }
224 if (result) { 237 if (result) {
225 clist_free(result); 238 newsnntp_list_free(result);
226 } 239 }
227 return res; 240 return res;
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h
index 4d03754..d51c955 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.h
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h
@@ -26,5 +26,5 @@ public:
26 /* mailbox will be ignored */ 26 /* mailbox will be ignored */
27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX"); 27 virtual void statusFolder(folderStat&target_stat,const QString & mailbox="INBOX");
28 QStringList listAllNewsgroups(); 28 QStringList listAllNewsgroups(const QString&mask = QString::null);
29 virtual void deleteMail(const RecMail&mail); 29 virtual void deleteMail(const RecMail&mail);
30 virtual void answeredMail(const RecMail&mail); 30 virtual void answeredMail(const RecMail&mail);