From ced65e8da0770e424e3702a876d392ae16f888ec Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Thu, 22 Feb 2007 18:47:41 +0000 Subject: [PATCH] fix issue downloading partial pop3 messages from stand-alone msg window opened from cross-folder saved search, sr=mscott 361279 git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@220750 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgDBView.cpp | 1 + .../base/src/nsMsgXFVirtualFolderDBView.cpp | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/mozilla/mailnews/base/src/nsMsgDBView.cpp b/mozilla/mailnews/base/src/nsMsgDBView.cpp index 1a5dbd89ebd..44d4a6d4515 100644 --- a/mozilla/mailnews/base/src/nsMsgDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgDBView.cpp @@ -5970,6 +5970,7 @@ nsresult nsMsgDBView::CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger *aMess aNewMsgDBView->m_viewFlags = m_viewFlags; aNewMsgDBView->m_sortOrder = m_sortOrder; aNewMsgDBView->m_sortType = m_sortType; + aNewMsgDBView->m_sortValid = m_sortValid; aNewMsgDBView->m_db = m_db; aNewMsgDBView->mDateFormater = mDateFormater; if (m_db) diff --git a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp index 55c4395b61c..c110437638a 100755 --- a/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp +++ b/mozilla/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp @@ -110,6 +110,30 @@ nsMsgXFVirtualFolderDBView::CopyDBView(nsMsgDBView *aNewMsgDBView, nsIMessenger newMsgDBView->m_viewFolder = m_viewFolder; newMsgDBView->m_searchSession = m_searchSession; + + PRInt32 scopeCount; + nsCOMPtr searchSession = do_QueryReferent(m_searchSession); + nsCOMPtr msgDBService = do_GetService(NS_MSGDB_SERVICE_CONTRACTID); + searchSession->CountSearchScopes(&scopeCount); + for (PRInt32 i = 0; i < scopeCount; i++) + { + nsMsgSearchScopeValue scopeId; + nsCOMPtr searchFolder; + searchSession->GetNthSearchScope(i, &scopeId, getter_AddRefs(searchFolder)); + if (searchFolder) + { + nsCOMPtr searchDB; + nsXPIDLCString searchUri; + m_viewFolder->GetURI(getter_Copies(searchUri)); + nsresult rv = searchFolder->GetMsgDatabase(nsnull, getter_AddRefs(searchDB)); + if (NS_SUCCEEDED(rv) && searchDB) + { + if (msgDBService) + msgDBService->RegisterPendingListener(searchFolder, newMsgDBView); + } + } + } + return NS_OK; }