fix assertion when imap delete happens during auto sync, imap delete doesn't need the folder semaphore, r=standard8, sr=neil, 456326
authorDavid Bienvenu <bienvenu@nventure.com>
Tue, 23 Sep 2008 16:08:01 -0700
changeset 413 01caea2439c84f3808455a61b7d7b3d502c8859f
parent 412 84a0c590dcc7ccb7a626f3e989c52f0121d16118
child 414 bf5ecaf124165107fc4a961663fe38222d05f513
push idunknown
push userunknown
push dateunknown
reviewersstandard8, neil, 456326
bugs456326
fix assertion when imap delete happens during auto sync, imap delete doesn't need the folder semaphore, r=standard8, sr=neil, 456326
mailnews/db/msgdb/public/nsImapMailDatabase.h
mailnews/db/msgdb/src/nsImapMailDatabase.cpp
--- a/mailnews/db/msgdb/public/nsImapMailDatabase.h
+++ b/mailnews/db/msgdb/public/nsImapMailDatabase.h
@@ -55,16 +55,18 @@ public:
   virtual nsresult AdjustExpungedBytesOnDelete(nsIMsgDBHdr *msgHdr);
 
   NS_IMETHOD    ForceClosed();
   NS_IMETHOD    SetFolderStream(nsIOutputStream *aFileStream);
   NS_IMETHOD    GetFolderStream(nsIOutputStream **aFileStream);
   NS_IMETHOD    AddNewHdrToDB(nsIMsgDBHdr *newHdr, PRBool notify);
   NS_IMETHOD    SetAttributesOnPendingHdr(nsIMsgDBHdr *pendingHdr, const char *property, 
                                   const char *propertyVal, PRInt32 flags);
+  NS_IMETHODIMP DeleteMessages(nsTArray<nsMsgKey>* nsMsgKeys, 
+                               nsIDBChangeListener *instigator);
 
 protected:
   // IMAP does not set local file flags, override does nothing
   virtual void	UpdateFolderFlag(nsIMsgDBHdr *msgHdr, PRBool bSet, 
                                   MsgFlags flag, nsIOutputStream **ppFileStream);
   virtual PRBool SetHdrFlag(nsIMsgDBHdr *msgHdr, PRBool bSet, MsgFlags flag);
 
    nsresult     GetAllPendingHdrsTable();
--- a/mailnews/db/msgdb/src/nsImapMailDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsImapMailDatabase.cpp
@@ -80,16 +80,25 @@ NS_IMETHODIMP	nsImapMailDatabase::SetSum
 }
 
 // IMAP does not set local file flags, override does nothing
 void	nsImapMailDatabase::UpdateFolderFlag(nsIMsgDBHdr * /* msgHdr */, PRBool /* bSet */,
                                               MsgFlags /* flag */, nsIOutputStream ** /* ppFileStream */)
 {
 }
 
+// We override this to avoid our parent class (nsMailDatabase)'s 
+// grabbing of the folder semaphore, and bailing on failure.
+NS_IMETHODIMP nsImapMailDatabase::DeleteMessages(nsTArray<nsMsgKey>* nsMsgKeys, nsIDBChangeListener *instigator)
+{
+  return nsMsgDatabase::DeleteMessages(nsMsgKeys, instigator);
+}
+
+// We override this so we won't try to change the x-mozilla-status flags
+// in the offline store.
 PRBool nsImapMailDatabase::SetHdrFlag(nsIMsgDBHdr *msgHdr, PRBool bSet, MsgFlags flag)
 {
   return nsMsgDatabase::SetHdrFlag(msgHdr, bSet, flag);
 }
 
 // override so nsMailDatabase methods that deal with m_folderStream are *not* called
 NS_IMETHODIMP nsImapMailDatabase::StartBatch()
 {