diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 3254e8bc88e..e8a591c6adf 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -222,8 +222,6 @@ nsImapMailFolder::nsImapMailFolder() : m_appendMsgMonitor = nsnull; // since we're not using this (yet?) make it null. // if we do start using it, it should be created lazily - nsresult rv; - m_thread = do_GetCurrentThread(); m_moveCoalescer = nsnull; m_boxFlags = 0; @@ -334,13 +332,15 @@ NS_IMETHODIMP nsImapMailFolder::AddSubfolder(const nsAString& aName, nsCAutoString uri(mURI); uri.Append('/'); - // convert name to imap modified utf7, like an imap server would - nsCAutoString utfFolderName; - rv = CopyUTF16toMUTF7(PromiseFlatString(aName), utfFolderName); + // If AddSubFolder starts getting called for folders other than virtual folders, + // we'll have to do convert those names to modified utf-7. For now, the account manager code + // that loads the virtual folders for each account, expects utf8 not modified utf-7. + nsCAutoString escapedName; + rv = NS_MsgEscapeEncodeURLPath(aName, escapedName); NS_ENSURE_SUCCESS(rv, rv); - uri += utfFolderName.get(); - + uri += escapedName.get(); + nsCOMPtr msgFolder; rv = GetChildWithURI(uri.get(), PR_FALSE/*deep*/, PR_TRUE /*case Insensitive*/, getter_AddRefs(msgFolder)); if (NS_SUCCEEDED(rv) && msgFolder)