Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 86 |
1 files changed, 48 insertions, 38 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 9b7c0e0..fe75a15 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -33,3 +33,3 @@ int IMAPwrapper::selectMbox(const QString&mbox) if ( err != MAILIMAP_NO_ERROR ) { - odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; + odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl; m_Lastmbox = ""; @@ -44,3 +44,3 @@ void IMAPwrapper::imap_progress( size_t current, size_t maximum ) qApp->processEvents(); - odebug << "IMAP: " << current << " of " << maximum << "" << oendl; + odebug << "IMAP: " << current << " of " << maximum << "" << oendl; } @@ -56,3 +56,3 @@ bool IMAPwrapper::start_tls(bool force_tls) Global::statusMessage("error getting capabilities!"); - odebug << "error getting capabilities!" << oendl; + odebug << "error getting capabilities!" << oendl; return false; @@ -77,3 +77,3 @@ bool IMAPwrapper::start_tls(bool force_tls) Global::statusMessage(tr("Server has no TLS support!")); - odebug << "Server has no TLS support!" << oendl; + odebug << "Server has no TLS support!" << oendl; try_tls = false; @@ -128,3 +128,3 @@ void IMAPwrapper::login() // cancel - odebug << "IMAP: Login canceled" << oendl; + odebug << "IMAP: Login canceled" << oendl; return; @@ -151,3 +151,3 @@ void IMAPwrapper::login() if ( ssl ) { - odebug << "using ssl" << oendl; + odebug << "using ssl" << oendl; err = mailimap_ssl_connect( m_imap, (char*)server, port ); @@ -179,3 +179,3 @@ void IMAPwrapper::login() Global::statusMessage(tr("Server has no TLS support!")); - odebug << "Server has no TLS support!" << oendl; + odebug << "Server has no TLS support!" << oendl; ok = false; @@ -239,2 +239,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma set = mailimap_set_new_interval( 1, last ); + + + fetchType = mailimap_fetch_type_new_all(); +/* fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); @@ -244,3 +248,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); - +*/ err = mailimap_fetch( m_imap, set, fetchType, &result ); @@ -320,3 +324,3 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() } else { - odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl; + odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl; } @@ -330,3 +334,3 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() if (!path) path = ""; - odebug << path << oendl; + odebug << path << oendl; err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); @@ -357,3 +361,3 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders() } else { - odebug << "error fetching folders " << m_imap->imap_response << "" << oendl; + odebug << "error fetching folders " << m_imap->imap_response << "" << oendl; } @@ -377,2 +381,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) } + size = 0; m = new RecMail(); @@ -380,3 +385,2 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) current = c; - size = 0; item = (mailimap_msg_att_item*)current->data; @@ -467,9 +471,16 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) #if 0 - mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; + mailimap_date_time*date = item->att_data.att_static->att_data.att_internal_date; + if (date->dt_sec>60 || date->dt_sec<0) date->dt_sec=0; + //QDateTime da(QDate(d->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec)); + QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" "; + timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" "; + timestring.sprintf(timestring+" %+05i",date->dt_zone); + m->setDate(timestring); QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); - odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl; - odebug << da.toString() << oendl; + odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl; + odebug << da.toString() << oendl; #endif } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { - size = item->att_data.att_static->att_data.att_rfc822_size; + //size = item->att_data.att_static->att_data.att_rfc822_size; + m->setMsgsize(item->att_data.att_static->att_data.att_rfc822_size); } @@ -483,3 +494,2 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) m->setFlags(mFlags); - m->setMsgsize(size); } @@ -527,3 +537,3 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) } else { - odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; + odebug << "error fetching body: " << m_imap->imap_response << "" << oendl; } @@ -639,3 +649,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int } else { - odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; + odebug << "error fetching text: " << m_imap->imap_response << "" << oendl; } @@ -666,3 +676,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t } - odebug << "ID = " << id.latin1() << "" << oendl; + odebug << "ID = " << id.latin1() << "" << oendl; currentPart->setIdentifier(id); @@ -707,3 +717,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t } - odebug << "ID(mpart) = " << id.latin1() << "" << oendl; + odebug << "ID(mpart) = " << id.latin1() << "" << oendl; } @@ -751,3 +761,3 @@ void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_tex sub = which->bd_media_text; - odebug << "Type= text/" << which->bd_media_text << "" << oendl; + odebug << "Type= text/" << which->bd_media_text << "" << oendl; target_part->setSubtype(sub.lower()); @@ -763,3 +773,3 @@ void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg* target_part->setSubtype("rfc822"); - odebug << "Message part" << oendl; + odebug << "Message part" << oendl; /* we set this type to text/plain */ @@ -822,3 +832,3 @@ void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_ba } - odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl; + odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl; target_part->setType(type.lower()); @@ -898,6 +908,6 @@ void IMAPwrapper::deleteMail(const RecMailP&mail) if (err != MAILIMAP_NO_ERROR) { - odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; + odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; return; } - odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; + odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; /* should we realy do that at this moment? */ @@ -905,5 +915,5 @@ void IMAPwrapper::deleteMail(const RecMailP&mail) if (err != MAILIMAP_NO_ERROR) { - odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; + odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl; } - odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; + odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; } @@ -933,3 +943,3 @@ void IMAPwrapper::answeredMail(const RecMailP&mail) if (err != MAILIMAP_NO_ERROR) { - odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; + odebug << "error marking mail: " << m_imap->imap_response << "" << oendl; return; @@ -1001,3 +1011,3 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder) } - odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; + odebug << "deleting mail: " << m_imap->imap_response << "" << oendl; /* should we realy do that at this moment? */ @@ -1008,3 +1018,3 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder) } - odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; + odebug << "Delete successfull " << m_imap->imap_response << "" << oendl; return 1; @@ -1033,3 +1043,3 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons } - odebug << "Creating " << pre.latin1() << "" << oendl; + odebug << "Creating " << pre.latin1() << "" << oendl; int res = mailimap_create(m_imap,pre.latin1()); @@ -1092,3 +1102,3 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) } else { - odebug << "Error retrieving status" << oendl; + odebug << "Error retrieving status" << oendl; } @@ -1116,3 +1126,3 @@ const QString&IMAPwrapper::getName()const { - odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; + odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl; return account->getAccountName(); @@ -1132,3 +1142,3 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); - odebug << "Using generic" << oendl; + odebug << "Using generic" << oendl; return; @@ -1151,3 +1161,3 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, Global::statusMessage(error_msg); - odebug << error_msg << oendl; + odebug << error_msg << oendl; return; @@ -1162,3 +1172,3 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra if (targetWrapper != this) { - odebug << "Using generic" << oendl; + odebug << "Using generic" << oendl; AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); @@ -1181,3 +1191,3 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra Global::statusMessage(error_msg); - odebug << error_msg << oendl; + odebug << error_msg << oendl; return; |