From ab560af906bcc84ad5160af6c26c4fa2e854cf3e Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Sat, 3 Jun 2000 22:19:47 +0000 Subject: [PATCH] fix upgrading of 4.x filters which are moves to local folders r=alecf,a=scottip 37320 --- mailnews/base/search/src/nsMsgFilter.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mailnews/base/search/src/nsMsgFilter.cpp b/mailnews/base/search/src/nsMsgFilter.cpp index f5b60eccfd5f..6d52bca84ca7 100644 --- a/mailnews/base/search/src/nsMsgFilter.cpp +++ b/mailnews/base/search/src/nsMsgFilter.cpp @@ -419,14 +419,21 @@ nsresult nsMsgFilter::ConvertMoveToFolderValue(nsCString &moveValue) } if (NS_SUCCEEDED(rv) && localMailRoot) { - nsCOMPtr destIFolder; - localMailRoot->FindSubFolder (moveValue, getter_AddRefs(destIFolder)); + nsXPIDLCString localRootURI; + nsCOMPtr destIMsgFolder; + nsCOMPtr localMailRootMsgFolder = do_QueryInterface(localMailRoot); + localMailRoot->GetURI(getter_Copies(localRootURI)); + nsCString destFolderUri = localRootURI; + // need to remove ".sbd" from moveValue, and perhaps escape it. + moveValue.ReplaceSubstring(".sbd/", "/"); + destFolderUri.Append('/'); + destFolderUri.Append(moveValue); - if (destIFolder) + localMailRootMsgFolder->GetChildWithURI (destFolderUri, PR_TRUE, getter_AddRefs(destIMsgFolder)); + + if (destIMsgFolder) { - nsCOMPtr msgFolder; - msgFolder = do_QueryInterface(destIFolder); - destIFolder->GetURI(getter_Copies(folderUri)); + destIMsgFolder->GetURI(getter_Copies(folderUri)); m_action.m_folderUri.Assign(folderUri); moveValue.Assign(folderUri); }