add rootMsgFolder accessor to incoming server, make rootFolder interCaps r/sr=sspitzer 119579

This commit is contained in:
bienvenu%netscape.com 2002-01-14 22:59:02 +00:00
Родитель d8cb6449b2
Коммит d38a3fb2f2
4 изменённых файлов: 24 добавлений и 16 удалений

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

@ -40,6 +40,7 @@
interface nsIFileSpec;
interface nsIFolder;
interface nsIMsgFolder;
interface nsIMsgFolderCache;
interface nsIMsgWindow;
interface nsIMsgFilterList;
@ -149,7 +150,10 @@ interface nsIMsgIncomingServer : nsISupports {
readonly attribute string serverURI;
/* the root folder for this server */
attribute nsIFolder RootFolder;
attribute nsIFolder rootFolder;
/* handy accessor when we want a msg folder */
readonly attribute nsIMsgFolder rootMsgFolder;
/* are we already getting new Messages on the current server..
This is used to help us prevent multiple get new msg commands from

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

@ -419,8 +419,7 @@ function GetWindowMediator()
function GetInboxFolder(server)
{
try {
var rootFolder = server.RootFolder;
var rootMsgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
var rootMsgFolder = server.rootMsgFolder;
//now find Inbox
var outNumFolders = new Object();
@ -794,9 +793,7 @@ function getDestinationFolder(preselectedFolder, server)
var isCreateSubfolders = preselectedFolder.canCreateSubfolders;
if (!isCreateSubfolders)
{
var tmpDestFolder = server.RootFolder;
destinationFolder
= tmpDestFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
destinationFolder = server.rootMsgFolder;
var verifyCreateSubfolders = null;
if (destinationFolder)
@ -809,9 +806,7 @@ function getDestinationFolder(preselectedFolder, server)
try {
var account = accountManager.defaultAccount;
var defaultServer = account.incomingServer;
var tmpDefaultFolder = defaultServer.RootFolder;
var defaultFolder
= tmpDefaultFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
var defaultFolder = defaultServer.rootMsgFolder;
var checkCreateSubfolders = null;
if (defaultFolder)

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

@ -370,7 +370,7 @@ function ServerContainsFolder(server, folder)
function SelectServer(server)
{
SelectFolder(server.RootFolder.URI);
SelectFolder(server.rootFolder.URI);
}
// we have this incoming server listener in case we need to
@ -520,8 +520,7 @@ function loadStartFolder(initialUri)
var defaultAccount = accountManager.defaultAccount;
defaultServer = defaultAccount.incomingServer;
var rootFolder = defaultServer.RootFolder;
var rootMsgFolder = rootFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
var rootMsgFolder = defaultServer.rootMsgFolder;
startFolderResource = rootMsgFolder.QueryInterface(Components.interfaces.nsIRDFResource);

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

@ -158,6 +158,18 @@ nsMsgIncomingServer::GetRootFolder(nsIFolder * *aRootFolder)
return NS_OK;
}
NS_IMETHODIMP
nsMsgIncomingServer::GetRootMsgFolder(nsIMsgFolder **aRootMsgFolder)
{
NS_ENSURE_ARG_POINTER(aRootMsgFolder);
nsCOMPtr <nsIFolder> rootFolder;
nsresult rv = GetRootFolder(getter_AddRefs(rootFolder));
if (NS_SUCCEEDED(rv) && rootFolder)
rv = rootFolder->QueryInterface(NS_GET_IID(nsIMsgFolder), (void **) aRootMsgFolder);
return rv;
}
NS_IMETHODIMP
nsMsgIncomingServer::PerformExpand(nsIMsgWindow *aMsgWindow)
{
@ -989,10 +1001,8 @@ nsMsgIncomingServer::GetFilterList(nsIMsgFilterList **aResult)
nsresult rv;
if (!mFilterList) {
nsCOMPtr<nsIFolder> folder;
rv = GetRootFolder(getter_AddRefs(folder));
nsCOMPtr<nsIMsgFolder> msgFolder(do_QueryInterface(folder, &rv));
nsCOMPtr<nsIMsgFolder> msgFolder;
rv = GetRootMsgFolder(getter_AddRefs(msgFolder));
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFileSpec> thisFolder;