Bug #55774: In GetListOfFoldersWithPath(), make sure we pass the right folder object to DiscoverChildren(). r=bienvenu, sr=sspitzer.

This commit is contained in:
cavin%netscape.com 2001-08-21 18:38:02 +00:00
parent aecb8ff748
commit 26a14368bc

View File

@ -3466,8 +3466,19 @@ nsImapService::GetListOfFoldersWithPath(nsIImapIncomingServer *aServer, nsIMsgWi
rv = pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(queue));
if (NS_FAILED(rv)) return rv;
// Locate the folder so that the correct hierarchical delimiter is used in the folder
// pathnames, otherwise root's (ie, '^') is used and this is wrong.
nsCOMPtr<nsIMsgFolder> msgFolder;
nsCOMPtr<nsIFolder> subFolder;
if (rootMsgFolder && folderPath && (*folderPath))
{
rv = rootMsgFolder->FindSubFolder(folderPath, getter_AddRefs(subFolder));
if (NS_SUCCEEDED(rv))
msgFolder = do_QueryInterface(subFolder);
}
rv = DiscoverChildren(queue, rootMsgFolder, listener, folderPath, nsnull);
rv = DiscoverChildren(queue, msgFolder, listener, folderPath, nsnull);
if (NS_FAILED(rv)) return rv;
return NS_OK;