send msgsClassified notification for fake headers added when doing fcc so that gloda will index them right away, r=protz, bug 646226
authorDavid Bienvenu <bienvenu@nventure.com>
Thu, 05 May 2011 15:41:18 -0700
changeset 7706 ec4c84e6984ad6004cbec1a3d9e2b74e742c9400
parent 7705 0f03867fe8ed8f4510db187f50edc870e105b922
child 7707 6f7ab0c3e629825b9eb66fef9b056f5ddc1ba576
push idunknown
push userunknown
push dateunknown
reviewersprotz, bug
bugs646226
send msgsClassified notification for fake headers added when doing fcc so that gloda will index them right away, r=protz, bug 646226
mailnews/imap/src/nsImapMailFolder.cpp
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -8251,16 +8251,21 @@ nsImapMailFolder::CopyFileToOfflineStore
               fakeHdr->SetMessageOffset(curOfflineStorePos);
               fakeHdr->OrFlags(nsMsgMessageFlags::Offline | nsMsgMessageFlags::Read, &resultFlags);
               fakeHdr->SetOfflineMessageSize(fileSize);
               fakeHdr->SetUint32Property("pseudoHdr", 1);
               mDatabase->AddNewHdrToDB(fakeHdr, PR_TRUE /* notify */);
               SetFlag(nsMsgFolderFlags::OfflineEvents);
               messages->AppendElement(fakeHdr, PR_FALSE);
               SetPendingAttributes(messages, PR_FALSE);
+              // Gloda needs this notification to index the fake message.
+              nsCOMPtr<nsIMsgFolderNotificationService>
+                notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
+              if (notifier)
+                notifier->NotifyMsgsClassified(messages, PR_FALSE, PR_FALSE);
             }
           }
           inputStream->Close();
           inputStream = nsnull;
           delete inputStreamBuffer;
         }
       }
     }