after deleting one mail from a POP3-based inbox,
no further moves/deletes are possible.
this happened to you if the file on disk was named INBOX,
or InBox (only Inbox was safe)

also made the fix for other special folder.

r/sr=bienvenu
This commit is contained in:
sspitzer%netscape.com 2003-03-22 02:13:46 +00:00
parent bfd19c222e
commit f7b312e408
2 changed files with 33 additions and 6 deletions

View File

@ -245,7 +245,7 @@ nsMsgLocalMailFolder::CreateSubFolders(nsFileSpec &path)
if (child)
{
nsXPIDLString folderName;
child->GetName(getter_Copies(folderName)); //try to get it from cache/db
child->GetName(getter_Copies(folderName)); // try to get it from cache/db
if (folderName.IsEmpty())
child->SetPrettyName(currentFolderNameStr.get());
}
@ -271,7 +271,34 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
nsXPIDLCString escapedName;
rv = NS_MsgEscapeEncodeURLPath((*name).get(), getter_Copies(escapedName));
NS_ENSURE_SUCCESS(rv,rv);
uri.Append(escapedName.get());
// fix for #192780
// if this is the root folder
// make sure the the special folders
// have the right uri.
// on disk, host\INBOX should be a folder with the uri mailbox://user@host/Inbox"
// as mailbox://user@host/Inbox != mailbox://user@host/INBOX
nsCOMPtr<nsIMsgFolder> rootFolder;
rv = GetRootFolder(getter_AddRefs(rootFolder));
if (NS_SUCCEEDED(rv) && rootFolder && (rootFolder.get() == (nsIMsgFolder *)this))
{
if (nsCRT::strcasecmp(escapedName.get(), "INBOX") == 0)
uri += "Inbox";
else if (nsCRT::strcasecmp(escapedName.get(), "UNSENT%20MESSAGES") == 0)
uri += "Unsent%20Messages";
else if (nsCRT::strcasecmp(escapedName.get(), "DRAFTS") == 0)
uri += "Drafts";
else if (nsCRT::strcasecmp(escapedName.get(), "TRASH") == 0)
uri += "Trash";
else if (nsCRT::strcasecmp(escapedName.get(), "SENT") == 0)
uri += "Sent";
else if (nsCRT::strcasecmp(escapedName.get(), "TEMPLATES") == 0)
uri +="Templates";
else
uri += escapedName.get();
}
else
uri += escapedName.get();
nsCOMPtr <nsIMsgFolder> msgFolder;
rv = GetChildWithURI(uri.get(), PR_FALSE/*deep*/, PR_TRUE /*case Insensitive*/, getter_AddRefs(msgFolder));
@ -301,8 +328,8 @@ NS_IMETHODIMP nsMsgLocalMailFolder::AddSubfolder(nsAutoString *name,
{
if(name->Equals(NS_LITERAL_STRING("Inbox"), nsCaseInsensitiveStringComparator()))
{
flags |= MSG_FOLDER_FLAG_INBOX;
SetBiffState(nsIMsgFolder::nsMsgBiffState_Unknown);
flags |= MSG_FOLDER_FLAG_INBOX;
SetBiffState(nsIMsgFolder::nsMsgBiffState_Unknown);
}
else if (name->Equals(NS_LITERAL_STRING("Trash"), nsCaseInsensitiveStringComparator()))
flags |= MSG_FOLDER_FLAG_TRASH;
@ -1202,7 +1229,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName, nsIMsgWind
if (mName.Equals(aNewName, nsCaseInsensitiveStringComparator()))
{
if(msgWindow)
rv=ThrowAlertMsg("folderExists", msgWindow);
rv = ThrowAlertMsg("folderExists", msgWindow);
return NS_MSG_FOLDER_EXISTS;
}
else

View File

@ -205,7 +205,7 @@ NS_IMETHODIMP nsPop3IncomingServer::CreateDefaultMailboxes(nsIFileSpec *path)
PRBool exists;
if (!path) return NS_ERROR_NULL_POINTER;
rv =path->AppendRelativeUnixPath("Inbox");
rv = path->AppendRelativeUnixPath("Inbox");
if (NS_FAILED(rv)) return rv;
rv = path->Exists(&exists);
if (!exists) {