author | alwin <alwin> | 2003-12-10 20:33:31 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-10 20:33:31 (UTC) |
commit | 7dc6ff83f138c78b6bd5e8a4d922a6e60c533a1f (patch) (side-by-side diff) | |
tree | c3f53894691dd71cbdf05e69603f7ac55ea2474c /noncore/net/mail/libmailwrapper | |
parent | 66aa51039689ab2dab153469d7f6527bcedd9318 (diff) | |
download | opie-7dc6ff83f138c78b6bd5e8a4d922a6e60c533a1f.zip opie-7dc6ff83f138c78b6bd5e8a4d922a6e60c533a1f.tar.gz opie-7dc6ff83f138c78b6bd5e8a4d922a6e60c533a1f.tar.bz2 |
changes to work with libetpan 0.3.1
Diffstat (limited to 'noncore/net/mail/libmailwrapper') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailwrapper.cpp | 50 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.cpp | 52 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/pop3wrapper.h | 1 |
3 files changed, 52 insertions, 51 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailwrapper.cpp b/noncore/net/mail/libmailwrapper/mailwrapper.cpp index 898e9d6..3ffc274 100644 --- a/noncore/net/mail/libmailwrapper/mailwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/mailwrapper.cpp @@ -199,3 +199,3 @@ mailmime *MailWrapper::buildTxtPart( QString str ) - err = clist_append( content->parameters, param ); + err = clist_append( content->ct_parameters, param ); if ( err != MAILIMF_NO_ERROR ) goto err_free_content; @@ -255,3 +255,3 @@ mailmime *MailWrapper::buildFilePart( QString filename, QString mimetype ) - err = clist_append( content->parameters, param ); + err = clist_append( content->ct_parameters, param ); if ( err != MAILIMF_NO_ERROR ) goto err_free_param; @@ -349,6 +349,6 @@ mailimf_field *MailWrapper::getField( mailimf_fields *fields, int type ) - it = clist_begin( fields->list ); + it = clist_begin( fields->fld_list ); while ( it ) { field = (mailimf_field *) it->data; - if ( field->type == type ) { + if ( field->fld_type == type ) { return field; @@ -365,3 +365,3 @@ static void addRcpts( clist *list, mailimf_address_list *addr_list ) - for ( it = clist_begin( addr_list->list ); it; it = it->next ) { + for ( it = clist_begin( addr_list->ad_list ); it; it = it->next ) { mailimf_address *addr; @@ -369,6 +369,6 @@ static void addRcpts( clist *list, mailimf_address_list *addr_list ) - if ( addr->type == MAILIMF_ADDRESS_MAILBOX ) { - esmtp_address_list_add( list, addr->mailbox->addr_spec, 0, NULL ); - } else if ( addr->type == MAILIMF_ADDRESS_GROUP ) { - clist *l = addr->group->mb_list->list; + if ( addr->ad_type == MAILIMF_ADDRESS_MAILBOX ) { + esmtp_address_list_add( list, addr->ad_data.ad_mailbox->mb_addr_spec, 0, NULL ); + } else if ( addr->ad_type == MAILIMF_ADDRESS_GROUP ) { + clist *l = addr->ad_data.ad_group->grp_mb_list->mb_list; for ( it2 = clist_begin( l ); it2; it2 = it2->next ) { @@ -376,3 +376,3 @@ static void addRcpts( clist *list, mailimf_address_list *addr_list ) mbox = (mailimf_mailbox *) it2->data; - esmtp_address_list_add( list, mbox->addr_spec, 0, NULL ); + esmtp_address_list_add( list, mbox->mb_addr_spec, 0, NULL ); } @@ -390,5 +390,5 @@ clist *MailWrapper::createRcptList( mailimf_fields *fields ) field = getField( fields, MAILIMF_FIELD_TO ); - if ( field && (field->type == MAILIMF_FIELD_TO) - && field->field.to->addr_list ) { - addRcpts( rcptList, field->field.to->addr_list ); + if ( field && (field->fld_type == MAILIMF_FIELD_TO) + && field->fld_data.fld_to->to_addr_list ) { + addRcpts( rcptList, field->fld_data.fld_to->to_addr_list ); } @@ -396,5 +396,5 @@ clist *MailWrapper::createRcptList( mailimf_fields *fields ) field = getField( fields, MAILIMF_FIELD_CC ); - if ( field && (field->type == MAILIMF_FIELD_CC) - && field->field.cc->addr_list ) { - addRcpts( rcptList, field->field.cc->addr_list ); + if ( field && (field->fld_type == MAILIMF_FIELD_CC) + && field->fld_data.fld_cc->cc_addr_list ) { + addRcpts( rcptList, field->fld_data.fld_cc->cc_addr_list ); } @@ -402,5 +402,5 @@ clist *MailWrapper::createRcptList( mailimf_fields *fields ) field = getField( fields, MAILIMF_FIELD_BCC ); - if ( field && (field->type == MAILIMF_FIELD_BCC) - && field->field.bcc->addr_list ) { - addRcpts( rcptList, field->field.bcc->addr_list ); + if ( field && (field->fld_type == MAILIMF_FIELD_BCC) + && field->fld_data.fld_bcc->bcc_addr_list ) { + addRcpts( rcptList, field->fld_data.fld_bcc->bcc_addr_list ); } @@ -415,6 +415,6 @@ char *MailWrapper::getFrom( mailmime *mail ) mailimf_field *ffrom; - ffrom = getField( mail->fields, MAILIMF_FIELD_FROM ); - if ( ffrom && (ffrom->type == MAILIMF_FIELD_FROM) - && ffrom->field.from->mb_list && ffrom->field.from->mb_list->list ) { - clist *cl = ffrom->field.from->mb_list->list; + ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM ); + if ( ffrom && (ffrom->fld_type == MAILIMF_FIELD_FROM) + && ffrom->fld_data.fld_from->frm_mb_list && ffrom->fld_data.fld_from->frm_mb_list->mb_list ) { + clist *cl = ffrom->fld_data.fld_from->frm_mb_list->mb_list; clistiter *it; @@ -422,3 +422,3 @@ char *MailWrapper::getFrom( mailmime *mail ) mailimf_mailbox *mb = (mailimf_mailbox *) it->data; - from = strdup( mb->addr_spec ); + from = strdup( mb->mb_addr_spec ); } @@ -544,3 +544,3 @@ void MailWrapper::smtpSend( mailmime *mail ) port = smtp->getPort().toUInt(); - rcpts = createRcptList( mail->fields ); + rcpts = createRcptList( mail->mm_data.mm_message.mm_fields ); diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp index 72f3c36..633faf6 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp @@ -35,5 +35,5 @@ void POP3wrapper::listMessages( QList<RecMail> &target ) - err = mailpop3_header( m_pop3, info->index, &header, &length ); + err = mailpop3_header( m_pop3, info->msg_index, &header, &length ); if ( err != MAILPOP3_NO_ERROR ) { - qDebug( "POP3: error retrieving header msgid: %i", info->index ); + qDebug( "POP3: error retrieving header msgid: %i", info->msg_index ); logout(); @@ -42,3 +42,3 @@ void POP3wrapper::listMessages( QList<RecMail> &target ) RecMail *mail = parseHeader( header ); - mail->setNumber( info->index ); + mail->setNumber( info->msg_index ); target.append( mail ); @@ -57,22 +57,22 @@ RecMail *POP3wrapper::parseHeader( const char *header ) err = mailimf_fields_parse( (char *) header, strlen( header ), &curTok, &fields ); - for ( clistiter *current = clist_begin( fields->list ); current != NULL; current = current->next ) { + for ( clistiter *current = clist_begin( fields->fld_list ); current != NULL; current = current->next ) { mailimf_field *field = (mailimf_field *) current->data; - switch ( field->type ) { + switch ( field->fld_type ) { case MAILIMF_FIELD_FROM: - mail->setFrom( *parseMailboxList( field->field.from->mb_list ) ); + mail->setFrom( *parseMailboxList( field->fld_data.fld_from->frm_mb_list ) ); break; case MAILIMF_FIELD_TO: - mail->setTo( *parseAddressList( field->field.to->addr_list ) ); + mail->setTo( *parseAddressList( field->fld_data.fld_to->to_addr_list ) ); break; case MAILIMF_FIELD_CC: - mail->setCC( *parseAddressList( field->field.cc->addr_list ) ); + mail->setCC( *parseAddressList( field->fld_data.fld_cc->cc_addr_list ) ); break; case MAILIMF_FIELD_BCC: - mail->setBcc( *parseAddressList( field->field.bcc->addr_list ) ); + mail->setBcc( *parseAddressList( field->fld_data.fld_bcc->bcc_addr_list ) ); break; case MAILIMF_FIELD_SUBJECT: - mail->setSubject( QString( field->field.subject->value ) ); + mail->setSubject( QString( field->fld_data.fld_subject->sbj_value ) ); break; case MAILIMF_FIELD_ORIG_DATE: - mail->setDate( *parseDateTime( field->field.orig_date->date_time ) ); + mail->setDate( *parseDateTime( field->fld_data.fld_orig_date->dt_date_time ) ); break; @@ -91,3 +91,3 @@ QString *POP3wrapper::parseDateTime( mailimf_date_time *date ) snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", - date->day, date->month, date->year, date->hour, date->min, date->sec, date->zone ); + date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); @@ -103,3 +103,3 @@ QString *POP3wrapper::parseAddressList( mailimf_address_list *list ) bool first = true; - for ( clistiter *current = clist_begin( list->list ); current != NULL; current = current->next ) { + for ( clistiter *current = clist_begin( list->ad_list ); current != NULL; current = current->next ) { mailimf_address *addr = (mailimf_address *) current->data; @@ -114,5 +114,5 @@ QString *POP3wrapper::parseAddressList( mailimf_address_list *list ) - switch ( addr->type ) { + switch ( addr->ad_type ) { case MAILIMF_ADDRESS_MAILBOX: - tmp = parseMailbox( addr->mailbox ); + tmp = parseMailbox( addr->ad_data.ad_mailbox ); result->append( *tmp ); @@ -121,3 +121,3 @@ QString *POP3wrapper::parseAddressList( mailimf_address_list *list ) case MAILIMF_ADDRESS_GROUP: - tmp = parseGroup( addr->group ); + tmp = parseGroup( addr->ad_data.ad_group ); result->append( *tmp ); @@ -138,7 +138,7 @@ QString *POP3wrapper::parseGroup( mailimf_group *group ) - result->append( group->display_name ); + result->append( group->grp_display_name ); result->append( ": " ); - if ( group->mb_list != NULL ) { - QString *tmp = parseMailboxList( group->mb_list ); + if ( group->grp_mb_list != NULL ) { + QString *tmp = parseMailboxList( group->grp_mb_list ); result->append( *tmp ); @@ -156,8 +156,8 @@ QString *POP3wrapper::parseMailbox( mailimf_mailbox *box ) - if ( box->display_name == NULL ) { - result->append( box->addr_spec ); + if ( box->mb_display_name == NULL ) { + result->append( box->mb_addr_spec ); } else { - result->append( box->display_name ); + result->append( box->mb_display_name ); result->append( " <" ); - result->append( box->addr_spec ); + result->append( box->mb_addr_spec ); result->append( ">" ); @@ -173,3 +173,3 @@ QString *POP3wrapper::parseMailboxList( mailimf_mailbox_list *list ) bool first = true; - for ( clistiter *current = clist_begin( list->list ); current != NULL; current = current->next ) { + for ( clistiter *current = clist_begin( list->mb_list ); current != NULL; current = current->next ) { mailimf_mailbox *box = (mailimf_mailbox *) current->data; @@ -214,3 +214,3 @@ void POP3wrapper::login() qDebug( "pop3: error connecting to %s\n reason: %s", server, - m_pop3->response ); + m_pop3->pop3_response ); mailpop3_free( m_pop3 ); @@ -225,3 +225,3 @@ void POP3wrapper::login() if ( err != MAILPOP3_NO_ERROR ) { - qDebug( "pop3: error logging in: %s", m_pop3->response ); + qDebug( "pop3: error logging in: %s", m_pop3->pop3_response ); logout(); diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h index a8937fb..4e4abad 100644 --- a/noncore/net/mail/libmailwrapper/pop3wrapper.h +++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h @@ -6,2 +6,3 @@ class RecMail; +struct mailpop3; |