-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 5 | ||||
-rw-r--r-- | noncore/net/mail/pop3wrapper.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index b4a8f4b..a33a16b 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp | |||
@@ -66,24 +66,26 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | |||
66 | char * header = 0; | 66 | char * header = 0; |
67 | /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */ | 67 | /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */ |
68 | size_t length = 0; | 68 | size_t length = 0; |
69 | carray * messages = 0; | 69 | carray * messages = 0; |
70 | 70 | ||
71 | login(); | 71 | login(); |
72 | if (!m_pop3) return; | 72 | if (!m_pop3) return; |
73 | mailpop3_list( m_pop3, &messages ); | 73 | mailpop3_list( m_pop3, &messages ); |
74 | 74 | ||
75 | for (unsigned int i = 0; i < carray_count(messages);++i) { | 75 | for (unsigned int i = 0; i < carray_count(messages);++i) { |
76 | mailpop3_msg_info *info; | 76 | mailpop3_msg_info *info; |
77 | err = mailpop3_get_msg_info(m_pop3,i+1,&info); | 77 | err = mailpop3_get_msg_info(m_pop3,i+1,&info); |
78 | if (info->msg_deleted) | ||
79 | continue; | ||
78 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); | 80 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); |
79 | if ( err != MAILPOP3_NO_ERROR ) { | 81 | if ( err != MAILPOP3_NO_ERROR ) { |
80 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); | 82 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); |
81 | free(header); | 83 | free(header); |
82 | return; | 84 | return; |
83 | } | 85 | } |
84 | RecMail *mail = parseHeader( header ); | 86 | RecMail *mail = parseHeader( header ); |
85 | mail->setNumber( info->msg_index ); | 87 | mail->setNumber( info->msg_index ); |
86 | mail->setWrapper(this); | 88 | mail->setWrapper(this); |
87 | mail->setMsgsize(info->msg_size); | 89 | mail->setMsgsize(info->msg_size); |
88 | target.append( mail ); | 90 | target.append( mail ); |
89 | free(header); | 91 | free(header); |
@@ -308,25 +310,25 @@ void POP3wrapper::logout() | |||
308 | { | 310 | { |
309 | int err = MAILPOP3_NO_ERROR; | 311 | int err = MAILPOP3_NO_ERROR; |
310 | if ( m_pop3 == NULL ) return; | 312 | if ( m_pop3 == NULL ) return; |
311 | err = mailpop3_quit( m_pop3 ); | 313 | err = mailpop3_quit( m_pop3 ); |
312 | mailpop3_free( m_pop3 ); | 314 | mailpop3_free( m_pop3 ); |
313 | m_pop3 = NULL; | 315 | m_pop3 = NULL; |
314 | } | 316 | } |
315 | 317 | ||
316 | 318 | ||
317 | QList<Folder>* POP3wrapper::listFolders() | 319 | QList<Folder>* POP3wrapper::listFolders() |
318 | { | 320 | { |
319 | /* TODO: integrate MH directories | 321 | /* TODO: integrate MH directories |
320 | but not vor version 0.1 ;) | 322 | but not before version 0.1 ;) |
321 | */ | 323 | */ |
322 | QList<Folder> * folders = new QList<Folder>(); | 324 | QList<Folder> * folders = new QList<Folder>(); |
323 | folders->setAutoDelete( false ); | 325 | folders->setAutoDelete( false ); |
324 | Folder*inb=new Folder("INBOX"); | 326 | Folder*inb=new Folder("INBOX"); |
325 | folders->append(inb); | 327 | folders->append(inb); |
326 | return folders; | 328 | return folders; |
327 | } | 329 | } |
328 | 330 | ||
329 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) | 331 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) |
330 | { | 332 | { |
331 | return ""; | 333 | return ""; |
332 | } | 334 | } |
@@ -335,12 +337,13 @@ void POP3wrapper::deleteMail(const RecMail&mail) | |||
335 | { | 337 | { |
336 | login(); | 338 | login(); |
337 | if (!m_pop3) return; | 339 | if (!m_pop3) return; |
338 | int err = mailpop3_dele(m_pop3,mail.getNumber()); | 340 | int err = mailpop3_dele(m_pop3,mail.getNumber()); |
339 | if (err != MAILPOP3_NO_ERROR) { | 341 | if (err != MAILPOP3_NO_ERROR) { |
340 | qDebug("error deleting mail"); | 342 | qDebug("error deleting mail"); |
341 | } | 343 | } |
342 | } | 344 | } |
343 | 345 | ||
344 | void POP3wrapper::answeredMail(const RecMail&) | 346 | void POP3wrapper::answeredMail(const RecMail&) |
345 | { | 347 | { |
346 | } | 348 | } |
349 | |||
diff --git a/noncore/net/mail/pop3wrapper.cpp b/noncore/net/mail/pop3wrapper.cpp index b4a8f4b..a33a16b 100644 --- a/noncore/net/mail/pop3wrapper.cpp +++ b/noncore/net/mail/pop3wrapper.cpp | |||
@@ -66,24 +66,26 @@ void POP3wrapper::listMessages(const QString &, QList<RecMail> &target ) | |||
66 | char * header = 0; | 66 | char * header = 0; |
67 | /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */ | 67 | /* these vars are used recurcive! set it to 0!!!!!!!!!!!!!!!!! */ |
68 | size_t length = 0; | 68 | size_t length = 0; |
69 | carray * messages = 0; | 69 | carray * messages = 0; |
70 | 70 | ||
71 | login(); | 71 | login(); |
72 | if (!m_pop3) return; | 72 | if (!m_pop3) return; |
73 | mailpop3_list( m_pop3, &messages ); | 73 | mailpop3_list( m_pop3, &messages ); |
74 | 74 | ||
75 | for (unsigned int i = 0; i < carray_count(messages);++i) { | 75 | for (unsigned int i = 0; i < carray_count(messages);++i) { |
76 | mailpop3_msg_info *info; | 76 | mailpop3_msg_info *info; |
77 | err = mailpop3_get_msg_info(m_pop3,i+1,&info); | 77 | err = mailpop3_get_msg_info(m_pop3,i+1,&info); |
78 | if (info->msg_deleted) | ||
79 | continue; | ||
78 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); | 80 | err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); |
79 | if ( err != MAILPOP3_NO_ERROR ) { | 81 | if ( err != MAILPOP3_NO_ERROR ) { |
80 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); | 82 | qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); |
81 | free(header); | 83 | free(header); |
82 | return; | 84 | return; |
83 | } | 85 | } |
84 | RecMail *mail = parseHeader( header ); | 86 | RecMail *mail = parseHeader( header ); |
85 | mail->setNumber( info->msg_index ); | 87 | mail->setNumber( info->msg_index ); |
86 | mail->setWrapper(this); | 88 | mail->setWrapper(this); |
87 | mail->setMsgsize(info->msg_size); | 89 | mail->setMsgsize(info->msg_size); |
88 | target.append( mail ); | 90 | target.append( mail ); |
89 | free(header); | 91 | free(header); |
@@ -308,25 +310,25 @@ void POP3wrapper::logout() | |||
308 | { | 310 | { |
309 | int err = MAILPOP3_NO_ERROR; | 311 | int err = MAILPOP3_NO_ERROR; |
310 | if ( m_pop3 == NULL ) return; | 312 | if ( m_pop3 == NULL ) return; |
311 | err = mailpop3_quit( m_pop3 ); | 313 | err = mailpop3_quit( m_pop3 ); |
312 | mailpop3_free( m_pop3 ); | 314 | mailpop3_free( m_pop3 ); |
313 | m_pop3 = NULL; | 315 | m_pop3 = NULL; |
314 | } | 316 | } |
315 | 317 | ||
316 | 318 | ||
317 | QList<Folder>* POP3wrapper::listFolders() | 319 | QList<Folder>* POP3wrapper::listFolders() |
318 | { | 320 | { |
319 | /* TODO: integrate MH directories | 321 | /* TODO: integrate MH directories |
320 | but not vor version 0.1 ;) | 322 | but not before version 0.1 ;) |
321 | */ | 323 | */ |
322 | QList<Folder> * folders = new QList<Folder>(); | 324 | QList<Folder> * folders = new QList<Folder>(); |
323 | folders->setAutoDelete( false ); | 325 | folders->setAutoDelete( false ); |
324 | Folder*inb=new Folder("INBOX"); | 326 | Folder*inb=new Folder("INBOX"); |
325 | folders->append(inb); | 327 | folders->append(inb); |
326 | return folders; | 328 | return folders; |
327 | } | 329 | } |
328 | 330 | ||
329 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) | 331 | QString POP3wrapper::fetchPart(const RecMail&,const RecPart&) |
330 | { | 332 | { |
331 | return ""; | 333 | return ""; |
332 | } | 334 | } |
@@ -335,12 +337,13 @@ void POP3wrapper::deleteMail(const RecMail&mail) | |||
335 | { | 337 | { |
336 | login(); | 338 | login(); |
337 | if (!m_pop3) return; | 339 | if (!m_pop3) return; |
338 | int err = mailpop3_dele(m_pop3,mail.getNumber()); | 340 | int err = mailpop3_dele(m_pop3,mail.getNumber()); |
339 | if (err != MAILPOP3_NO_ERROR) { | 341 | if (err != MAILPOP3_NO_ERROR) { |
340 | qDebug("error deleting mail"); | 342 | qDebug("error deleting mail"); |
341 | } | 343 | } |
342 | } | 344 | } |
343 | 345 | ||
344 | void POP3wrapper::answeredMail(const RecMail&) | 346 | void POP3wrapper::answeredMail(const RecMail&) |
345 | { | 347 | { |
346 | } | 348 | } |
349 | |||