From fedfcececb0ca88049c28a2d76286c5071d05618 Mon Sep 17 00:00:00 2001 From: "naving%netscape.com" Date: Sat, 16 Feb 2002 03:11:03 +0000 Subject: [PATCH] 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. --- mailnews/imap/public/nsIMsgImapMailFolder.idl | 2 +- mailnews/imap/src/nsImapIncomingServer.cpp | 2 +- mailnews/imap/src/nsImapMailFolder.cpp | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mailnews/imap/public/nsIMsgImapMailFolder.idl b/mailnews/imap/public/nsIMsgImapMailFolder.idl index 909e3d16800..83e432d20e0 100644 --- a/mailnews/imap/public/nsIMsgImapMailFolder.idl +++ b/mailnews/imap/public/nsIMsgImapMailFolder.idl @@ -56,7 +56,7 @@ interface nsIMsgImapFolderProps : nsISupports { [scriptable, uuid(FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2)] interface nsIMsgImapMailFolder : nsISupports { 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 renameLocal(in string newname, in nsIMsgFolder parent); void prepareToRename(); diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp index aacdbdb14d4..17262c1c0bb 100644 --- a/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mailnews/imap/src/nsImapIncomingServer.cpp @@ -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); a_nsIFolder->GetChildWithURI(uri.get(), PR_TRUE, caseInsensitive , getter_AddRefs(child)); } diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 345ddae253f..5ea8a2015eb 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -558,7 +558,7 @@ NS_IMETHODIMP nsImapMailFolder::GetSubFolders(nsIEnumerator* *result) if (NS_FAILED(rv) || numFolders == 0 || !inboxFolder) { // create an inbox if we don't have one. - CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0); + CreateClientSubfolderInfo("INBOX", kOnlineHierarchySeparatorUnknown,0, PR_TRUE); } } UpdateSummaryTotals(PR_FALSE); @@ -639,7 +639,7 @@ nsImapMailFolder::UpdateFolder(nsIMsgWindow *msgWindow) GetHasSubFolders(&hasSubFolders); if (!hasSubFolders) { - rv = CreateClientSubfolderInfo("Inbox", kOnlineHierarchySeparatorUnknown,0); + rv = CreateClientSubfolderInfo("Inbox", kOnlineHierarchySeparatorUnknown,0, PR_FALSE); if (NS_FAILED(rv)) return rv; } @@ -732,7 +732,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateSubfolder(const PRUnichar* folderName, nsI 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; @@ -786,7 +786,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName if (NS_FAILED(rv)) return rv; nsCAutoString leafnameC; 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. @@ -853,6 +853,8 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName } } nsCOMPtr folderCreateAtom; + if (!suppressNotification) + { if(NS_SUCCEEDED(rv) && child) { nsCOMPtr childSupports(do_QueryInterface(child)); @@ -870,6 +872,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); NotifyFolderEvent(folderCreateAtom); } + } return rv; }