Bug #270261 --> port thunderbird 1.0 fix back to the trunk...

Junk folder created incorrectly when junkFolderName is localized

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2004-12-20 23:47:56 +00:00
parent 9ba9ab9d39
commit 14dd7eca86

View File

@ -696,6 +696,7 @@ nsresult IsRFC822HeaderFieldName(const char *aHdr, PRBool *aResult)
return NS_OK;
}
// Warning, currently this routine only works for the Junk Folder
nsresult
GetOrCreateFolder(const nsACString &aURI, nsIUrlListener *aListener)
{
@ -747,9 +748,20 @@ GetOrCreateFolder(const nsACString &aURI, nsIUrlListener *aListener)
folderPath->Exists(&exists);
if (!exists)
{
// Hack to work around a localization bug with the Junk Folder.
// Please see Bug #270261 for more information...
nsXPIDLString localizedJunkName;
msgFolder->GetName(getter_Copies(localizedJunkName));
// force the junk folder name to be Junk so it gets created on disk correctly...
msgFolder->SetName(NS_LITERAL_STRING("Junk").get());
rv = msgFolder->CreateStorageIfMissing(aListener);
NS_ENSURE_SUCCESS(rv,rv);
// now restore the localized folder name...
msgFolder->SetName(localizedJunkName.get());
// XXX TODO
// JUNK MAIL RELATED
// ugh, I hate this hack