Summary: | forwarding messages in imap folders with load on demand enabled makes them dissappear from the headers list temporarily | ||
---|---|---|---|
Product: | [Applications] kmail | Reporter: | Till Adam <adam> |
Component: | IMAP | Assignee: | kdepim bugs <kdepim-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | critical | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Till Adam
2004-01-11 23:58:24 UTC
Subject: kdepim/kmail CVS commit by burghard: Overriding the msgSize is no good for mbox. The msg was unGetted, the new msgbase inherits the msgsize and the next read in getMsg broke things. As the msgLength is not saved in the index I have to take a different approach to override LOD for small messages: after the header was downloaded we check the size again and then fall back to loading "TEXT". CCMAIL: 72432-done@bugs.kde.org M +8 -0 imapaccountbase.cpp 1.37 M +2 -1 imapjob.cpp 1.41 M +1 -2 kmfolderimap.cpp 1.163 --- kdepim/kmail/imapaccountbase.cpp #1.36:1.37 @@ -545,4 +545,12 @@ namespace KMail { return; } + // check the size, if the message is smaller than 5KB then load it in one go + if ( msg->msgLength() < 5000 ) + { + FolderJob *job = msg->parent()->createJob( + msg, FolderJob::tGetMessage, 0, "TEXT" ); + job->start(); + return; + } // download parts according to attachmentstrategy --- kdepim/kmail/imapjob.cpp #1.40:1.41 @@ -302,5 +302,6 @@ void ImapJob::slotGetMessageResult( KIO: msg->fromByteArray( (*it).data ); msg->setHeaderField("X-UID",uid); - msg->setMsgSize(size); + // set correct size + msg->setMsgLength(size); if ( mPartSpecifier.isEmpty() ) msg->setComplete( true ); --- kdepim/kmail/kmfolderimap.cpp #1.162:1.163 @@ -1029,5 +1029,5 @@ void KMFolderImap::slotGetMessagesData(K flagsToStatus((KMMsgBase*)msg, flags); // set the correct size - msg->setMsgSize( msg->headerField("X-Length").toUInt() ); + msg->setMsgLength( msg->headerField("X-Length").toUInt() ); close(); @@ -1051,5 +1051,4 @@ KMFolderImap::doCreateJob( KMMessage *ms if ( jt == FolderJob::tGetMessage && partSpecifier == "STRUCTURE" && mAccount && mAccount->loadOnDemand() && - ( msg->msgSize() > 5000 || msg->msgSize() < 600 ) && // the lower bound is for msgs with unknown total size ( msg->signatureState() == KMMsgNotSigned || msg->signatureState() == KMMsgSignatureStateUnknown ) ) |