SF.net SVN: mahogany: [7273] trunk/M/src/mail/MailFolderCC.cpp

[email protected]
Newsgroups gmane.mail.mahogany.cvs
Message-ID <[email protected]>
Revision: 7273
          http://svn.sourceforge.net/mahogany/?rev=7273&view=rev
Author:   vadz
Date:     2007-05-18 05:21:51 -0700 (Fri, 18 May 2007)

Log Message:
-----------
fix bug with status of the folder getting out of sync when a new message was received while a previous new message was still being processed by delaying status invalidation as we already do for new mail processing

Modified Paths:
--------------
    trunk/M/src/mail/MailFolderCC.cpp

Modified: trunk/M/src/mail/MailFolderCC.cpp
===================================================================
--- trunk/M/src/mail/MailFolderCC.cpp	2007-05-18 12:21:41 UTC (rev 7272)
+++ trunk/M/src/mail/MailFolderCC.cpp	2007-05-18 12:21:51 UTC (rev 7273)
@@ -4591,23 +4591,6 @@
          // because we're inside c-client now and it is not reentrant, so we
          // send an event to ourselves to do it slightly later
          MEventManager::Send(new MEventFolderOnNewMailData(this));
-
-         // the number of unread/marked/... messages may have changed (there
-         // could be some more of them among the new ones), so forget the
-         // old values
-         //
-         // NB: we can't assume that the status hasn't changed just because
-         //     all new mail was filtered away because we might have some
-         //     non new messages as well and the flags of the existing ones
-         //     could have been changed from the outside
-         //
-         // NB2: don't do it for the temp (nameless) folders as we don't
-         //      cache their status anyhow
-         const String name = GetName();
-         if ( !name.empty() )
-         {
-            MfStatusCache::Get()->InvalidateStatus(name);
-         }
       }
       else // empty folder
       {
@@ -4724,6 +4707,22 @@
    wxLogTrace(TRACE_MF_EVENTS, _T("Got new mail notification for '%s'"),
               GetName().c_str());
 
+   // the number of unread/marked/... messages may have changed (there
+   // could be some more of them among the new ones), so forget the
+   // old values
+   //
+   // NB: we can't assume that all new messages are new (i.e. unread) and
+   //     update the status directly here, this would be wrong when old
+   //     messages are moved to the mailbox
+   //
+   // NB2: don't do it for the temp (nameless) folders as we don't
+   //      cache their status anyhow
+   const String name = GetName();
+   if ( !name.empty() )
+   {
+      MfStatusCache::Get()->InvalidateStatus(name);
+   }
+
    // should we notify the GUI about the new mail in the folder?
    //
    // normally it should always be done so that the list of messages could be


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.