Bug 748997 - New mail notification issue since upgrading to TB12. Move the num new message count initialization to the right place. r=Standard8
authorDavid Bienvenu <dbienvenu@mozilla.com>
Sat, 28 Apr 2012 14:45:29 +0100
changeset 11995 8a7ac25a378ae584a162ce127db88e29ee596806
parent 11994 57de5d517557b845432685200d03a864e8308eb0
child 11996 14888d952b42c7fcec2a4d7bb5e272b54c6a3280
push id599
push usermconley@mozilla.com
push dateMon, 16 Jul 2012 20:33:12 +0000
treeherdercomm-beta@c3489d5b7b65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs748997
Bug 748997 - New mail notification issue since upgrading to TB12. Move the num new message count initialization to the right place. r=Standard8
mailnews/local/src/nsPop3Sink.cpp
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
@@ -291,16 +291,18 @@ nsPop3Sink::BeginMailDelivery(bool uidlD
   {
     PR_LOG(POP3LOGMODULE, PR_LOG_MAX, ("BeginMailDelivery folder locked"));
     return NS_MSG_FOLDER_BUSY;
   }
   m_uidlDownload = uidlDownload;
   if (!uidlDownload)
     FindPartialMessages();
 
+  m_folder->GetNumNewMessages(false, &m_numNewMessagesInFolder);
+
 #ifdef DEBUG
   printf("Begin mail message delivery.\n");
 #endif
   nsCOMPtr<nsIPop3Service> pop3Service(do_GetService(NS_POP3SERVICE_CONTRACTID1, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   pop3Service->NotifyDownloadStarted(m_folder);
   if (aBool)
     *aBool = true;
@@ -563,17 +565,16 @@ nsPop3Sink::IncorporateBegin(const char*
   nsCOMPtr<nsISeekableStream> seekableOutStream = do_QueryInterface(m_outFileStream);
 
   // create a new mail parser
   m_newMailParser = new nsParseNewMailState;
   NS_ENSURE_TRUE(m_newMailParser, NS_ERROR_OUT_OF_MEMORY);
   if (m_uidlDownload)
     m_newMailParser->DisableFilters();
 
-  m_folder->GetNumNewMessages(false, &m_numNewMessagesInFolder);
   nsCOMPtr <nsIMsgFolder> serverFolder;
   rv = GetServerFolder(getter_AddRefs(serverFolder));
   if (NS_FAILED(rv)) return rv;
 
   rv = m_newMailParser->Init(serverFolder, m_folder,
                              m_window, newHdr, m_outFileStream);
   // If we failed to initialize the parser, then just don't use it!!!
   // We can still continue without one.