Bug #3609 --> pass the msg window into discover all folders.

clear the waiting for connection info flag if the user cancels out of the authentication dialogs...
set the url can run but busy flag if we are waiting for connection info. This prevents us from trying to
create a raw protocol connection without going through the request over ride info for webmail.
sr=bienvenu
This commit is contained in:
mscott%netscape.com 2001-01-19 02:00:58 +00:00
parent ca0f1fc00b
commit cada50118b
2 changed files with 38 additions and 28 deletions

View File

@ -675,8 +675,9 @@ nsImapIncomingServer::CreateImapConnection(nsIEventQueue *aEventQueue,
rv = mailnewsUrl->GetMsgWindow(getter_AddRefs(aMsgWindow));
RequestOverrideInfo(aMsgWindow);
canRunButBusy = PR_TRUE;
}
canRunButBusy = PR_TRUE;
}
// if we got here and we have a connection, then we should return it!
if (canRunUrlImmediately && connection)
@ -845,7 +846,7 @@ nsImapIncomingServer::PerformExpand(nsIMsgWindow *aMsgWindow)
rv = pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD, getter_AddRefs(queue));
if (NS_FAILED(rv)) return rv;
rv = imapService->DiscoverAllFolders(queue, rootMsgFolder, this, nsnull);
rv = imapService->DiscoverAllFolders(queue, rootMsgFolder, this, aMsgWindow, nsnull);
return rv;
}
@ -2003,11 +2004,17 @@ nsresult nsImapIncomingServer::RequestOverrideInfo(nsIMsgWindow *aMsgWindow)
// if we still don't have a password then the user must have hit cancel so just
// fall out...
if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0)
{
// be sure to clear the waiting for connection info flag because we aren't waiting
// anymore for a connection...
m_waitingForConnectionInfo = PR_FALSE;
return NS_OK;
}
}
nsCOMPtr<nsIPrompt> dialogPrompter;
aMsgWindow->GetPromptDialog(getter_AddRefs(dialogPrompter));
if (aMsgWindow)
aMsgWindow->GetPromptDialog(getter_AddRefs(dialogPrompter));
rv = m_logonRedirector->Logon(userName, password, dialogPrompter, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap);
}
}

View File

@ -1627,37 +1627,40 @@ NS_IMETHODIMP
nsImapService::DiscoverAllFolders(nsIEventQueue* aClientEventQueue,
nsIMsgFolder* aImapMailFolder,
nsIUrlListener* aUrlListener,
nsIMsgWindow * aMsgWindow,
nsIURI** aURL)
{
NS_ASSERTION (aImapMailFolder && aClientEventQueue,
"Oops ... null aClientEventQueue or aImapMailFolder");
if (!aImapMailFolder || ! aClientEventQueue)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIImapUrl> aImapUrl;
nsCAutoString urlSpec;
NS_ASSERTION (aImapMailFolder && aClientEventQueue,
"Oops ... null aClientEventQueue or aImapMailFolder");
if (!aImapMailFolder || ! aClientEventQueue)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsIImapUrl> imapUrl;
nsCAutoString urlSpec;
PRUnichar hierarchySeparator = GetHierarchyDelimiter(aImapMailFolder);
nsresult rv = CreateStartOfImapUrl(nsnull, getter_AddRefs(aImapUrl),
aImapMailFolder,
aUrlListener, urlSpec, hierarchySeparator);
if (NS_SUCCEEDED (rv))
nsresult rv = CreateStartOfImapUrl(nsnull, getter_AddRefs(imapUrl),
aImapMailFolder,
aUrlListener, urlSpec, hierarchySeparator);
if (NS_SUCCEEDED (rv))
{
rv = SetImapUrlSink(aImapMailFolder, imapUrl);
if (NS_SUCCEEDED(rv))
{
rv = SetImapUrlSink(aImapMailFolder, aImapUrl);
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIURI> uri = do_QueryInterface(aImapUrl);
urlSpec.Append("/discoverallboxes");
nsCOMPtr <nsIURI> url = do_QueryInterface(aImapUrl, &rv);
rv = uri->SetSpec((char *) urlSpec.GetBuffer());
if (NS_SUCCEEDED(rv))
rv = GetImapConnectionAndLoadUrl(aClientEventQueue, aImapUrl,
nsnull, aURL);
}
nsCOMPtr<nsIURI> uri = do_QueryInterface(imapUrl);
nsCOMPtr<nsIMsgMailNewsUrl> mailnewsurl = do_QueryInterface(imapUrl);
if (mailnewsurl)
mailnewsurl->SetMsgWindow(aMsgWindow);
urlSpec.Append("/discoverallboxes");
nsCOMPtr <nsIURI> url = do_QueryInterface(imapUrl, &rv);
rv = uri->SetSpec((char *) urlSpec.GetBuffer());
if (NS_SUCCEEDED(rv))
rv = GetImapConnectionAndLoadUrl(aClientEventQueue, imapUrl,
nsnull, aURL);
}
return rv;
}
return rv;
}
NS_IMETHODIMP