summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/genericwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/genericwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp52
1 files changed, 39 insertions, 13 deletions
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index eb2c031..137a6ef 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -35,3 +35,3 @@ void Genericwrapper::fillSingleBody(RecPart&target,mailmessage*,mailmime*mime)
35 } 35 }
36 36
37 mailmime_content*type = fields.fld_content; 37 mailmime_content*type = fields.fld_content;
@@ -147,3 +147,3 @@ void Genericwrapper::traverseBody(RecBody&target,mailmessage*message,mailmime*mi
147 RecPart part; 147 RecPart part;
148 148
149 switch (mime->mm_type) { 149 switch (mime->mm_type) {
@@ -243,6 +243,6 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date )
243 char tmp[23]; 243 char tmp[23];
244 244
245 snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", 245 snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i",
246 date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 246 date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
247 247
248 return QString( tmp ); 248 return QString( tmp );
@@ -258,3 +258,3 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list )
258 mailimf_address *addr = (mailimf_address *) current->data; 258 mailimf_address *addr = (mailimf_address *) current->data;
259 259
260 if ( !first ) { 260 if ( !first ) {
@@ -277,3 +277,3 @@ QString Genericwrapper::parseAddressList( mailimf_address_list *list )
277 } 277 }
278 278
279 return result; 279 return result;
@@ -293,3 +293,3 @@ QString Genericwrapper::parseGroup( mailimf_group *group )
293 result.append( ";" ); 293 result.append( ";" );
294 294
295 return result; 295 return result;
@@ -309,3 +309,3 @@ QString Genericwrapper::parseMailbox( mailimf_mailbox *box )
309 } 309 }
310 310
311 return result; 311 return result;
@@ -326,6 +326,6 @@ QString Genericwrapper::parseMailboxList( mailimf_mailbox_list *list )
326 } 326 }
327 327
328 result.append( parseMailbox( box ) ); 328 result.append( parseMailbox( box ) );
329 } 329 }
330 330
331 return result; 331 return result;
@@ -369,2 +369,22 @@ void Genericwrapper::cleanMimeCache()
369 369
370QStringList Genericwrapper::parseInreplies(mailimf_in_reply_to * in_replies)
371{
372 QStringList res;
373 if (!in_replies || !in_replies->mid_list) return res;
374 clistiter * current = 0;
375 for ( current = clist_begin( in_replies->mid_list ); current != NULL; current = current->next ) {
376 QString h((char*)current->data);
377 while (h.length()>0 && h[0]=='<') {
378 h.remove(0,1);
379 }
380 while (h.length()>0 && h[h.length()-1]=='>') {
381 h.remove(h.length()-1,1);
382 }
383 if (h.length()>0) {
384 res.append(h);
385 }
386 }
387 return res;
388}
389
370void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to) 390void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const QString&mailbox,bool mbox_as_to)
@@ -386,3 +406,4 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
386 } 406 }
387 mailimf_references * refs; 407 mailimf_references * refs = 0;
408 mailimf_in_reply_to * in_replies = 0;
388 uint32_t i = 0; 409 uint32_t i = 0;
@@ -428,4 +449,5 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
428 mail->setMsgid(QString(single_fields.fld_message_id->mid_value)); 449 mail->setMsgid(QString(single_fields.fld_message_id->mid_value));
429 qDebug("Msqgid == %s",mail->Msgid().latin1()); 450 qDebug("Msgid == %s",mail->Msgid().latin1());
430 } 451 }
452
431 refs = single_fields.fld_references; 453 refs = single_fields.fld_references;
@@ -435,2 +457,6 @@ void Genericwrapper::parseList(QList<RecMail> &target,mailsession*session,const
435 } 457 }
458 if (single_fields.fld_in_reply_to && single_fields.fld_in_reply_to->mid_list &&
459 clist_count(single_fields.fld_in_reply_to->mid_list)) {
460 mail->setInreply(parseInreplies(single_fields.fld_in_reply_to));
461 }
436 target.append(mail); 462 target.append(mail);