author | alwin <alwin> | 2004-03-06 01:53:46 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-06 01:53:46 (UTC) |
commit | dcddc2bbe09153468a5d994c64011a5dc175baad (patch) (unidiff) | |
tree | 416af037e0147f214fc478a133f78e85343e541d | |
parent | 4aea85aa2e205040da3ebdf50debde8b296e3c61 (diff) | |
download | opie-dcddc2bbe09153468a5d994c64011a5dc175baad.zip opie-dcddc2bbe09153468a5d994c64011a5dc175baad.tar.gz opie-dcddc2bbe09153468a5d994c64011a5dc175baad.tar.bz2 |
- subscribed NG will displayed in main windows
- we get the list of articles inside a newsgroup
- we can read an article
ToDo:
- filter article for that are read.
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.cpp | 15 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/nntpwrapper.h | 2 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 1 |
3 files changed, 11 insertions, 7 deletions
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp index ecdf848..798879d 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.cpp | |||
@@ -93,20 +93,20 @@ RecBody NNTPwrapper::fetchBody( const RecMail &mail ) { | |||
93 | free(message); | 93 | free(message); |
94 | 94 | ||
95 | return body; | 95 | return body; |
96 | } | 96 | } |
97 | 97 | ||
98 | 98 | ||
99 | void NNTPwrapper::listMessages(const QString &, QList<RecMail> &target ) | 99 | void NNTPwrapper::listMessages(const QString & which, QList<RecMail> &target ) |
100 | { | 100 | { |
101 | login(); | 101 | login(); |
102 | if (!m_nntp) | 102 | if (!m_nntp) |
103 | return; | 103 | return; |
104 | uint32_t res_messages,res_recent,res_unseen; | 104 | uint32_t res_messages,res_recent,res_unseen; |
105 | mailsession_status_folder(m_nntp->sto_session,"INBOX",&res_messages,&res_recent,&res_unseen); | 105 | mailsession_status_folder(m_nntp->sto_session,(char*)which.latin1(),&res_messages,&res_recent,&res_unseen); |
106 | parseList(target,m_nntp->sto_session,"INBOX"); | 106 | parseList(target,m_nntp->sto_session,which); |
107 | } | 107 | } |
108 | 108 | ||
109 | void NNTPwrapper::login() | 109 | void NNTPwrapper::login() |
110 | { | 110 | { |
111 | if (account->getOffline()) | 111 | if (account->getOffline()) |
112 | return; | 112 | return; |
@@ -189,14 +189,19 @@ void NNTPwrapper::logout() | |||
189 | } | 189 | } |
190 | 190 | ||
191 | QList<Folder>* NNTPwrapper::listFolders() { | 191 | QList<Folder>* NNTPwrapper::listFolders() { |
192 | 192 | ||
193 | QList<Folder> * folders = new QList<Folder>(); | 193 | QList<Folder> * folders = new QList<Folder>(); |
194 | folders->setAutoDelete( false ); | 194 | folders->setAutoDelete( false ); |
195 | 195 | QStringList groups; | |
196 | // folders->append(inb); | 196 | if (account) { |
197 | groups = account->getGroups(); | ||
198 | } | ||
199 | for ( QStringList::Iterator it = groups.begin(); it != groups.end(); ++it ) { | ||
200 | folders->append(new Folder((*it),".")); | ||
201 | } | ||
197 | return folders; | 202 | return folders; |
198 | } | 203 | } |
199 | 204 | ||
200 | clist * NNTPwrapper::listAllNewsgroups() { | 205 | clist * NNTPwrapper::listAllNewsgroups() { |
201 | login(); | 206 | login(); |
202 | clist *result = 0; | 207 | clist *result = 0; |
diff --git a/noncore/net/mail/libmailwrapper/nntpwrapper.h b/noncore/net/mail/libmailwrapper/nntpwrapper.h index e4d4a37..e8e2cf4 100644 --- a/noncore/net/mail/libmailwrapper/nntpwrapper.h +++ b/noncore/net/mail/libmailwrapper/nntpwrapper.h | |||
@@ -22,13 +22,13 @@ public: | |||
22 | /* mailbox will be ignored */ | 22 | /* mailbox will be ignored */ |
23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); | 23 | virtual void listMessages(const QString & mailbox, QList<RecMail> &target ); |
24 | /* should only get the subscribed one */ | 24 | /* should only get the subscribed one */ |
25 | virtual QList<Folder>* listFolders(); | 25 | virtual QList<Folder>* listFolders(); |
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 | clist * listAllNewsgroups(); | 28 | clist * listAllNewsgroups(); |
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); |
31 | virtual int deleteAllMail(const Folder*); | 31 | virtual int deleteAllMail(const Folder*); |
32 | 32 | ||
33 | virtual RecBody fetchBody( const RecMail &mail ); | 33 | virtual RecBody fetchBody( const RecMail &mail ); |
34 | virtual encodedString* fetchRawBody(const RecMail&mail); | 34 | virtual encodedString* fetchRawBody(const RecMail&mail); |
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index f64c17d..0d34fd5 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -435,7 +435,6 @@ void NNTPaccount::save() | |||
435 | 435 | ||
436 | 436 | ||
437 | QString NNTPaccount::getFileName() | 437 | QString NNTPaccount::getFileName() |
438 | { | 438 | { |
439 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file; | 439 | return (QString) getenv( "HOME" ) + "/Applications/opiemail/nntp-" + file; |
440 | } | 440 | } |
441 | |||