more work for logon referral, r=mscott (+ backout inadvertent checkin to nsImapMailFolder.cpp

This commit is contained in:
bienvenu%netscape.com 2000-02-16 00:53:43 +00:00
Родитель 88c0d8e924
Коммит 8c5f8aeec1
3 изменённых файлов: 16 добавлений и 7 удалений

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

@ -397,11 +397,12 @@ nsImapIncomingServer::CreateImapConnection(nsIEventQueue *aEventQueue,
nsCOMPtr<nsIImapProtocol> freeConnection;
PRBool isBusy = PR_FALSE;
PRBool isInboxConnection = PR_FALSE;
PRBool isAOLServer = PR_FALSE;
nsXPIDLCString redirectorType;
PR_CEnterMonitor(this);
GetIsAOLServer(&isAOLServer);
GetRedirectorType(getter_Copies(redirectorType));
PRBool redirectLogon = ((const char *) redirectorType && nsCRT::strlen((const char *) redirectorType) > 0);
PRInt32 maxConnections = 5; // default to be five
rv = GetMaximumConnectionsNumber(&maxConnections);
@ -448,7 +449,7 @@ nsImapIncomingServer::CreateImapConnection(nsIEventQueue *aEventQueue,
if (ConnectionTimeOut(freeConnection))
freeConnection = null_nsCOMPtr();
if (isAOLServer && (!connection || !canRunUrl))
if (redirectLogon && (!connection || !canRunUrl))
{
// here's where we'd start the asynchronous process of requesting a connection to the
// AOL Imap server and getting back an ip address, port #, and cookie.
@ -457,7 +458,12 @@ nsImapIncomingServer::CreateImapConnection(nsIEventQueue *aEventQueue,
if (!m_waitingForConnectionInfo)
{
m_waitingForConnectionInfo = PR_TRUE;
RequestOverrideInfo();
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl, &rv);
nsCOMPtr<nsIMsgWindow> aMsgWindow;
if (NS_SUCCEEDED(rv))
rv = mailnewsUrl->GetMsgWindow(getter_AddRefs(aMsgWindow));
RequestOverrideInfo(aMsgWindow);
hasToWait = PR_TRUE;
}
}
@ -1551,7 +1557,7 @@ NS_IMETHODIMP nsImapIncomingServer::CreatePRUnicharStringFromUTF7(const char * a
return CreateUnicodeStringFromUtf7(aSourceString, aUnicodeStr);
}
nsresult nsImapIncomingServer::RequestOverrideInfo()
nsresult nsImapIncomingServer::RequestOverrideInfo(nsIMsgWindow *aMsgWindow)
{
nsresult rv;
@ -1574,6 +1580,9 @@ nsresult nsImapIncomingServer::RequestOverrideInfo()
GetUsername(getter_Copies(userName));
GetPassword(getter_Copies(password));
if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0)
PromptForPassword(getter_Copies(password), aMsgWindow);
rv = redirector->Logon(userName, password, logonRedirectorRequester);
}
}

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

@ -70,7 +70,7 @@ private:
nsIImapProtocol** aImapConnection);
nsresult CreateProtocolInstance(nsIEventQueue *aEventQueue,
nsIImapProtocol ** aImapConnection);
nsresult RequestOverrideInfo();
nsresult RequestOverrideInfo(nsIMsgWindow *aMsgWindow);
PRBool ConnectionTimeOut(nsIImapProtocol* aImapConnection);
nsCOMPtr<nsISupportsArray> m_connectionCache;

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

@ -317,7 +317,7 @@ nsresult nsImapMailFolder::CreateSubFolders(nsFileSpec &path)
nsCOMPtr <nsIFileSpec> curFolder;
// don't strip off the .msf in currentFolderPath.
// currentFolderPath.SetLeafName(currentFolderNameStr);
currentFolderPath.SetLeafName(currentFolderNameStr);
rv = NS_NewFileSpecWithSpec(currentFolderPath, getter_AddRefs(curFolder));
currentFolderDBNameStr = currentFolderNameStr;