fix check for new pop3 mail when download on check not set, r/sr=standard8, 458625
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 26 Aug 2009 16:05:06 -0700
changeset 3432 b58c2df96f561d2f3317cd232340edb5cb1350de
parent 3431 60a433653c6cb3ae3bdc2bd8bf1bb323ce234aba
child 3433 a09a7d1c82d7e57ab96565ff4b537b4b1462d7dd
push idunknown
push userunknown
push dateunknown
bugs458625
fix check for new pop3 mail when download on check not set, r/sr=standard8, 458625
mailnews/local/src/nsPop3Protocol.cpp
--- a/mailnews/local/src/nsPop3Protocol.cpp
+++ b/mailnews/local/src/nsPop3Protocol.cpp
@@ -843,17 +843,17 @@ nsresult nsPop3Protocol::LoadUrl(nsIURI*
   NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get the url spect");
 
   m_pop3ConData->only_check_for_new_mail = (PL_strcasestr(queryPart.get(), "check") != nsnull);
   m_pop3ConData->verify_logon = (PL_strcasestr(queryPart.get(), "verifyLogon") != nsnull);
   m_pop3ConData->get_url = (PL_strcasestr(queryPart.get(), "gurl") != nsnull);
 
   PRBool deleteByAgeFromServer = PR_FALSE;
   PRInt32 numDaysToLeaveOnServer = -1;
-  if (!m_pop3ConData->only_check_for_new_mail && !m_pop3ConData->verify_logon)
+  if (!m_pop3ConData->verify_logon)
   {
     // Pick up pref setting regarding leave messages on server, message size limit
 
     m_pop3Server->GetLeaveMessagesOnServer(&m_pop3ConData->leave_on_server);
     m_pop3Server->GetHeadersOnly(&m_pop3ConData->headers_only);
     PRBool limitMessageSize = PR_FALSE;
 
     nsCOMPtr<nsIMsgIncomingServer> server = do_QueryInterface(m_pop3Server);
@@ -2008,24 +2008,26 @@ nsPop3Protocol::GetStat()
     m_pop3ConData->next_state = POP3_SEND_QUIT;
     PL_HashTableEnumerateEntries(m_pop3ConData->uidlinfo->hash, hash_clear_mapper, nsnull);
     // Hack - use nsPop3Sink to wipe out any stale Partial messages
     m_nsIPop3Sink->BeginMailDelivery(PR_FALSE, nsnull, nsnull);
     m_nsIPop3Sink->AbortMailDelivery(this);
     return(0);
   }
 
-  if (m_pop3ConData->only_check_for_new_mail && !m_pop3ConData->leave_on_server &&
-      m_pop3ConData->size_limit <= 0)
+  /* We're just checking for new mail, and we're not playing any games that
+     involve keeping messages on the server.  Therefore, we now know enough
+     to finish up.  If we had no messages, that would have been handled
+     above; therefore, we know we have some new messages. 
+  */
+  if (m_pop3ConData->only_check_for_new_mail && !m_pop3ConData->leave_on_server)
   {
-    /* We're just checking for new mail, and we're not playing any games that
-       involve keeping messages on the server.  Therefore, we now know enough
-       to finish up.  If we had no messages, that would have been handled
-       above; therefore, we know we have some new messages. */
-    m_pop3ConData->biffstate = nsIMsgFolder::nsMsgBiffState_NewMail;
+    m_nsIPop3Sink->SetBiffStateAndUpdateFE(nsIMsgFolder::nsMsgBiffState_NewMail,
+                                           m_pop3ConData->number_of_messages,
+                                           PR_TRUE);
     m_pop3ConData->next_state = POP3_SEND_QUIT;
     return(0);
   }
 
 
   if (!m_pop3ConData->only_check_for_new_mail)
   {
       /* The following was added to prevent the loss of Data when we try and