[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 64566] messages missing in IMAP folder
From:       Carsten Burghardt <cb () magic-shop ! de>
Date:       2004-05-09 15:24:29
Message-ID: 20040509152429.32080.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=64566      
cb magic-shop de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From cb magic-shop de  2004-05-09 17:24 -------
CVS commit by burghard: 

Check if we definitely know the message before deleting it.
Some servers send the fetch results not in uid order and this caused trouble.
CCMAIL: 64566-done bugs kde org


  M +26 -4     kmfolderimap.cpp   1.197


--- kdepim/kmail/kmfolderimap.cpp  #1.196:1.197
 @ -831,5 +831,6  @ void KMFolderImap::slotListFolderResult(
   if (job->error())
   {
-    mAccount->handleJobError( job, i18n("Error while listing the contents of a folder.") );
+    mAccount->handleJobError( job, 
+        i18n("Error while listing the contents of the folder %1.").arg( label() ) );
     quiet( false );
     emit folderComplete(this, FALSE);
 @ -872,5 +873,4  @ void KMFolderImap::slotListFolderResult(
     (*uid).truncate((*uid).find(","));
   ImapAccountBase::jobData jd( QString::null, (*it).parent );
-//jd.items = (*it).items;
   jd.total = (*it).items.count();
   if (jd.total == 0)
 @ -1037,5 +1037,27  @ void KMFolderImap::slotGetMessagesData(K
     flags = msg->headerField("X-Flags").toInt();
     ulong uid = msg->UID();
-    if (flags & 8 || uid <= lastUid()) {
+    bool ok = true;
+    if ( uid <= lastUid() )
+    {
+      // as some servers send the messages out of order
+      // we have to check if the message really already exists
+      int idx = 0;
+      KMMsgBase *msg;
+      while ( idx < count() )
+      {
+        msg = getMsgBase( idx );
+        if ( msg && msg->UID() == uid )
+        {
+          ok = false; // exists, no need to create it
+          break;
+        }
+        ++idx;
+      }
+    }
+    // deleted flag
+    if ( flags & 8 ) 
+      ok = false;
+    if ( !ok )
+    {
       delete msg;
       msg = 0;
 @ -1588,5 +1610,5  @ KMFolderImap::setUserRights( unsigned in
 {
   mUserRights = userRights;
-  kdDebug() << imapPath() << " setUserRights: " << userRights << endl;
+  kdDebug(5006) << imapPath() << " setUserRights: " << userRights << endl;
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic