109761 r=bienvenu sr=sspitzer Suppress RDF/Outliner notifications when creating new INBOX, will happen on migrating imap accts or creating new imap accts, confuses outliner, ends up showing 2 INBOX es.

This commit is contained in:
naving%netscape.com 2002-02-16 03:11:03 +00:00
Родитель 4e7adb888f
Коммит fedfcececb
3 изменённых файлов: 9 добавлений и 6 удалений

Просмотреть файл

@ -56,7 +56,7 @@ interface nsIMsgImapFolderProps : nsISupports {
[scriptable, uuid(FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2)] [scriptable, uuid(FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2)]
interface nsIMsgImapMailFolder : nsISupports { interface nsIMsgImapMailFolder : nsISupports {
void removeSubFolder(in nsIMsgFolder folder); void removeSubFolder(in nsIMsgFolder folder);
void createClientSubfolderInfo(in string folderName, in wchar hierarchyDelimiter, in long flags); void createClientSubfolderInfo(in string folderName, in wchar hierarchyDelimiter, in long flags, in boolean suppressNotification);
void list(); void list();
void renameLocal(in string newname, in nsIMsgFolder parent); void renameLocal(in string newname, in nsIMsgFolder parent);
void prepareToRename(); void prepareToRename();

Просмотреть файл

@ -1266,7 +1266,7 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char *folderPath,
} }
} }
hostFolder->CreateClientSubfolderInfo(dupFolderPath.get(), hierarchyDelimiter,boxFlags); hostFolder->CreateClientSubfolderInfo(dupFolderPath.get(), hierarchyDelimiter,boxFlags, PR_FALSE);
caseInsensitive = (nsCRT::strcasecmp("INBOX", dupFolderPath.get())== 0); caseInsensitive = (nsCRT::strcasecmp("INBOX", dupFolderPath.get())== 0);
a_nsIFolder->GetChildWithURI(uri.get(), PR_TRUE, caseInsensitive , getter_AddRefs(child)); a_nsIFolder->GetChildWithURI(uri.get(), PR_TRUE, caseInsensitive , getter_AddRefs(child));
} }

Просмотреть файл

@ -558,7 +558,7 @@ NS_IMETHODIMP nsImapMailFolder::GetSubFolders(nsIEnumerator* *result)
if (NS_FAILED(rv) || numFolders == 0 || !inboxFolder) if (NS_FAILED(rv) || numFolders == 0 || !inboxFolder)
{ {
// create an inbox if we don't have one. // create an inbox if we don't have one.
CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0); CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0, PR_TRUE);
} }
} }
UpdateSummaryTotals(PR_FALSE); UpdateSummaryTotals(PR_FALSE);
@ -639,7 +639,7 @@ nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow)
GetHasSubFolders(&hasSubFolders); GetHasSubFolders(&hasSubFolders);
if (!hasSubFolders) if (!hasSubFolders)
{ {
rv = CreateClientSubfolderInfo("Inbox", kOnlineHierarchySeparatorUnknown,0); rv = CreateClientSubfolderInfo("Inbox", kOnlineHierarchySeparatorUnknown,0, PR_FALSE);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
} }
@ -732,7 +732,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const PRUnichar* folderName, nsI
return rv; return rv;
} }
NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName, PRUnichar hierarchyDelimiter, PRInt32 flags) NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName, PRUnichar hierarchyDelimiter, PRInt32 flags, PRBool suppressNotification)
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -786,7 +786,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsCAutoString leafnameC; nsCAutoString leafnameC;
leafnameC.AssignWithConversion(leafName); leafnameC.AssignWithConversion(leafName);
return parentFolder->CreateClientSubfolderInfo(leafnameC.get(), hierarchyDelimiter,flags); return parentFolder->CreateClientSubfolderInfo(leafnameC.get(), hierarchyDelimiter,flags, suppressNotification);
} }
// if we get here, it's really a leaf, and "this" is the parent. // if we get here, it's really a leaf, and "this" is the parent.
@ -853,6 +853,8 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
} }
} }
nsCOMPtr <nsIAtom> folderCreateAtom; nsCOMPtr <nsIAtom> folderCreateAtom;
if (!suppressNotification)
{
if(NS_SUCCEEDED(rv) && child) if(NS_SUCCEEDED(rv) && child)
{ {
nsCOMPtr<nsISupports> childSupports(do_QueryInterface(child)); nsCOMPtr<nsISupports> childSupports(do_QueryInterface(child));
@ -870,6 +872,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed"));
NotifyFolderEvent(folderCreateAtom); NotifyFolderEvent(folderCreateAtom);
} }
}
return rv; return rv;
} }