fix cancelling from imap password prompt r=sspitzer, sr=mscott 111071

This commit is contained in:
bienvenu%netscape.com 2001-11-21 01:45:59 +00:00
parent 5e7783a929
commit 55cb9ebe61
3 changed files with 6 additions and 2 deletions

View File

@ -105,6 +105,8 @@ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MAILNEWS, value)
#define NS_MSG_FAILED(err) \
(NS_IS_MSG_ERROR(err) && NS_FAILED(err))
#define NS_MSG_PASSWORD_PROMPT_CANCELLED NS_MSG_GENERATE_SUCCESS(1)
/* is this where we define our errors? Obviously, there has to be a central
place so we don't use the same error codes.
*/

View File

@ -2218,7 +2218,7 @@ NS_IMETHODIMP nsImapIncomingServer::PromptForPassword(char ** aPassword,
nsresult rv = GetPasswordWithUI(passwordText, passwordTitle, aMsgWindow,
&okayValue, aPassword);
nsTextFormatter::smprintf_free(passwordText);
return rv;
return (okayValue) ? rv : NS_MSG_PASSWORD_PROMPT_CANCELLED;
}
// for the nsIImapServerSink interface

View File

@ -6564,7 +6564,9 @@ PRBool nsImapProtocol::TryToLogon()
rv = GetMsgWindow(getter_AddRefs(aMsgWindow));
if (NS_FAILED(rv)) return rv;
}
m_imapServerSink->PromptForPassword(getter_Copies(password), aMsgWindow);
rv = m_imapServerSink->PromptForPassword(getter_Copies(password), aMsgWindow);
if (rv == NS_MSG_PASSWORD_PROMPT_CANCELLED)
break;
}
PRBool imapPasswordIsNew = PR_FALSE;