fix handling of saved searches over new messages when msgs are moved/deleted, r=rkent, sr=neil, 372372
authorDavid Bienvenu <bienvenu@nventure.com>
Sun, 16 Aug 2009 07:47:38 -0700
changeset 3314 130c2798990c86252fc329aeb68113c60590b455
parent 3313 1d473ed592a04a75790b24c77c04dd7bff284203
child 3315 1355a82a79b856af976943bca37b7253f3a01459
push idunknown
push userunknown
push dateunknown
reviewersrkent, neil, 372372
bugs372372
fix handling of saved searches over new messages when msgs are moved/deleted, r=rkent, sr=neil, 372372
mailnews/base/src/nsMsgAccountManager.cpp
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -2621,17 +2621,23 @@ NS_IMETHODIMP VirtualFolderChangeListene
 NS_IMETHODIMP VirtualFolderChangeListener::OnHdrDeleted(nsIMsgDBHdr *aHdrDeleted, nsMsgKey aParentKey, PRInt32 aFlags, nsIDBChangeListener *aInstigator)
 {
   nsCOMPtr <nsIMsgDatabase> msgDB;
 
   nsresult rv = m_folderWatching->GetMsgDatabase(getter_AddRefs(msgDB));
   NS_ENSURE_SUCCESS(rv, rv);
   PRBool match = PR_FALSE;
   m_searchSession->AddScopeTerm(nsMsgSearchScope::offlineMail, m_folderWatching);
+  // Since the notifier went to the trouble of passing in the msg flags,
+  // we should use them when doing the match.
+  PRUint32 msgFlags;
+  aHdrDeleted->GetFlags(&msgFlags);
+  aHdrDeleted->SetFlags(aFlags);
   rv = m_searchSession->MatchHdr(aHdrDeleted, msgDB, &match);
+  aHdrDeleted->SetFlags(msgFlags);
   m_searchSession->ClearScopes();
   if (match)
   {
     nsCOMPtr <nsIMsgDatabase> virtDatabase;
     nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;
 
     rv = m_virtualFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(virtDatabase));
     NS_ENSURE_SUCCESS(rv, rv);