зеркало из https://github.com/mozilla/gecko-dev.git
Bug #23788 --> in order for the logon redirector to work for smtp and imap we need to pass in a service ID request
token. r=bienvenu a=phil
This commit is contained in:
Родитель
417094058a
Коммит
2d70636dd5
|
@ -12,6 +12,15 @@ interface nsMsgLogonRedirectionStates
|
|||
const long Validating = 4;
|
||||
};
|
||||
|
||||
typedef long nsMsgLogonRedirectionServiceID;
|
||||
|
||||
[scriptable, uuid(182CB845-EB0D-11d3-98B7-001083010E9B)]
|
||||
interface nsMsgLogonRedirectionServiceIDs
|
||||
{
|
||||
const long Imap = 0;
|
||||
const long Smtp = 1;
|
||||
};
|
||||
|
||||
[scriptable, uuid(3c882b66-df4f-11d3-b9f9-00108335942a)]
|
||||
interface nsIMsgLogonRedirectionRequester : nsISupports
|
||||
{
|
||||
|
@ -29,7 +38,7 @@ interface nsIMsgLogonRedirectionRequester : nsISupports
|
|||
[scriptable, uuid(0c2e96ac-e0ae-11d3-a560-0060b0fc04b7)]
|
||||
interface nsIMsgLogonRedirector : nsISupports
|
||||
{
|
||||
void Logon(in string userName, in string password, in nsIMsgLogonRedirectionRequester listener);
|
||||
void Logon(in string userName, in string password, in nsIMsgLogonRedirectionRequester listener, in nsMsgLogonRedirectionServiceID aServiceID);
|
||||
void Logoff(in string userName); /* might not need this one */
|
||||
};
|
||||
|
||||
|
|
|
@ -1425,27 +1425,27 @@ NS_IMETHODIMP nsImapIncomingServer::PseudoInterruptMsgLoad(nsIImapUrl *aImapUrl,
|
|||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRBool canRunUrl = PR_FALSE;
|
||||
PRBool hasToWait = PR_FALSE;
|
||||
PRBool hasToWait = PR_FALSE;
|
||||
nsCOMPtr<nsIImapProtocol> connection;
|
||||
|
||||
PR_CEnterMonitor(this);
|
||||
PR_CEnterMonitor(this);
|
||||
|
||||
// iterate through the connection cache for a connection that is loading
|
||||
// a message in this folder and should be pseudo-interrupted.
|
||||
PRUint32 cnt;
|
||||
nsCOMPtr<nsISupports> aSupport;
|
||||
nsCOMPtr<nsISupports> aSupport;
|
||||
|
||||
rv = m_connectionCache->Count(&cnt);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
for (PRUint32 i = 0; i < cnt && !canRunUrl && !hasToWait; i++)
|
||||
{
|
||||
aSupport = getter_AddRefs(m_connectionCache->ElementAt(i));
|
||||
connection = do_QueryInterface(aSupport);
|
||||
rv = m_connectionCache->Count(&cnt);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
for (PRUint32 i = 0; i < cnt && !canRunUrl && !hasToWait; i++)
|
||||
{
|
||||
aSupport = getter_AddRefs(m_connectionCache->ElementAt(i));
|
||||
connection = do_QueryInterface(aSupport);
|
||||
if (connection)
|
||||
rv = connection->PseudoInterruptMsgLoad(aImapUrl, interrupted);
|
||||
}
|
||||
|
||||
PR_CExitMonitor(this);
|
||||
PR_CExitMonitor(this);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1591,7 +1591,7 @@ nsresult nsImapIncomingServer::RequestOverrideInfo(nsIMsgWindow *aMsgWindow)
|
|||
|
||||
if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0)
|
||||
PromptForPassword(getter_Copies(password), aMsgWindow);
|
||||
rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester);
|
||||
rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1682,10 +1682,9 @@ NS_IMETHODIMP nsImapIncomingServer::OnLogonRedirectionReply(const PRUnichar *pHo
|
|||
nsCAutoString cookie(pCookieData, pCookieSize);
|
||||
// Get current thread envent queue
|
||||
NS_WITH_SERVICE(nsIEventQueueService, pEventQService, kEventQueueServiceCID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && pEventQService)
|
||||
if (NS_SUCCEEDED(rv) && pEventQService)
|
||||
pEventQService->GetThreadEventQueue(NS_CURRENT_THREAD,
|
||||
getter_AddRefs(aEventQueue));
|
||||
|
||||
// logoff so some one else can use the connection.
|
||||
if (m_logonRedirector)
|
||||
{
|
||||
|
@ -1694,6 +1693,7 @@ NS_IMETHODIMP nsImapIncomingServer::OnLogonRedirectionReply(const PRUnichar *pHo
|
|||
GetUsername(getter_Copies(userName));
|
||||
m_logonRedirector->Logoff(userName);
|
||||
}
|
||||
|
||||
m_redirectedLogonRetries = 0; // we got through, so reset this counter.
|
||||
|
||||
PRUint32 cnt = 0;
|
||||
|
|
Загрузка…
Ссылка в новой задаче