summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/nntpwrapper.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
index e73a890..c68964d 100644
--- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp
@@ -167,5 +167,7 @@ void NNTPwrapper::login()
mailstorage_free(m_nntp);
m_nntp = 0;
+
}
+
}
@@ -180,17 +182,29 @@ void NNTPwrapper::logout()
QList<Folder>* NNTPwrapper::listFolders() {
+
+
+
+
QList<Folder> * folders = new QList<Folder>();
folders->setAutoDelete( false );
clist *result = 0;
+ clistcell *current;
+ newsnntp_group_description *list;
- // int err =
-// if ( err == _NO_ERROR ) {
-// current = result->first;
-// for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
-
+ login();
+ if ( m_nntp ) {
+ mailsession * session = m_nntp->sto_session;
+ newsnntp * news = ( ( nntp_session_state_data * )session->sess_data )->nntp_session;
+ int err = newsnntp_list_newsgroups(news, NULL, &result);
+ if ( err == NEWSNNTP_NO_ERROR ) {
+ current = result->first;
+ for ( current=clist_begin(result);current!=NULL;current=clist_next(current)) {
+ list = ( newsnntp_group_description* ) current->data;
+ qDebug( list->grp_name );
+ }
// Folder*inb=new Folder("INBOX","/");
-
-
+ }
+ }
// folders->append(inb);
return folders;