fix offline tag change playback, r=standard8, sr=neil, 141606
authorDavid Bienvenu <bienvenu@nventure.com>
Wed, 27 Aug 2008 07:13:58 -0700
changeset 200 69676cb419aa0ec0080cd1fa22d8f067862c05c5
parent 199 f022678f2f2d9f092241bccc569ba073011b556c
child 201 3e7fddeda96500d95a6502cf4c7dfd5b22ea87d7
push idunknown
push userunknown
push dateunknown
reviewersstandard8, neil, 141606
bugs141606
fix offline tag change playback, r=standard8, sr=neil, 141606
mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
--- a/mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
+++ b/mailnews/db/msgdb/src/nsMsgOfflineImapOperation.cpp
@@ -219,16 +219,17 @@ NS_IMETHODIMP nsMsgOfflineImapOperation:
   NS_ENSURE_ARG(aKeywords);
   nsresult rv = m_mdb->GetProperty(m_mdbRow, PROP_KEYWORD_ADD, getter_Copies(m_keywordsToAdd));
   *aKeywords = ToNewCString(m_keywordsToAdd);
   return rv;
 }
 
 NS_IMETHODIMP nsMsgOfflineImapOperation::AddKeywordToAdd(const char * aKeyword)
 {
+  SetOperation(kAddKeywords);
   return AddKeyword(aKeyword, m_keywordsToAdd, PROP_KEYWORD_ADD, m_keywordsToRemove, PROP_KEYWORD_REMOVE);
 }
 
 NS_IMETHODIMP nsMsgOfflineImapOperation::GetKeywordsToRemove(char * *aKeywords)
 {
   NS_ENSURE_ARG(aKeywords);
   nsresult rv = m_mdb->GetProperty(m_mdbRow, PROP_KEYWORD_REMOVE, getter_Copies(m_keywordsToRemove));
   *aKeywords = ToNewCString(m_keywordsToRemove);
@@ -247,22 +248,22 @@ nsresult nsMsgOfflineImapOperation::AddK
   }
   // if the keyword we're removing was in the list of keywords to add,
   // cut it from that list.
   if (MsgFindKeyword(nsDependentCString(aKeyword), removeList, &startOffset, &keywordLength))
   {
     removeList.Cut(startOffset, keywordLength);
     m_mdb->SetProperty(m_mdbRow, removeProp, removeList.get());
   }
-  SetOperation(kRemoveKeywords);
   return m_mdb->SetProperty(m_mdbRow, addProp, addList.get());
 }
 
 NS_IMETHODIMP nsMsgOfflineImapOperation::AddKeywordToRemove(const char * aKeyword)
 {
+  SetOperation(kRemoveKeywords);
   return AddKeyword(aKeyword, m_keywordsToRemove, PROP_KEYWORD_REMOVE, m_keywordsToAdd, PROP_KEYWORD_ADD);
 }
 
 
 NS_IMETHODIMP nsMsgOfflineImapOperation::AddMessageCopyOperation(const char *destinationBox)
 {
   SetOperation(kMsgCopy);
   nsCAutoString newDest(destinationBox);