From 7cd3da05a1958975904b4fd9acc5b4bc9c07d133 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Tue, 21 Mar 2000 06:11:51 +0000 Subject: [PATCH] Bug #32008 --> add a requiresPassword method which we can use to prevent us from always asking the user for a password whenever we need to logon to an external service. r=bienvenu --- mailnews/imap/src/nsImapIncomingServer.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp index 8f06ae27b81..0dc020ddcff 100644 --- a/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mailnews/imap/src/nsImapIncomingServer.cpp @@ -1595,14 +1595,19 @@ nsresult nsImapIncomingServer::RequestOverrideInfo(nsIMsgWindow *aMsgWindow) { nsXPIDLCString password; nsXPIDLCString userName; + PRBool requiresPassword = PR_TRUE; GetUsername(getter_Copies(userName)); - GetPassword(getter_Copies(password)); + m_logonRedirector->RequiresPassword(userName, &requiresPassword); + if (requiresPassword) + { + GetPassword(getter_Copies(password)); - if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0) - PromptForPassword(getter_Copies(password), aMsgWindow); - if (password) - rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap); + if (!((const char *) password) || nsCRT::strlen((const char *) password) == 0) + PromptForPassword(getter_Copies(password), aMsgWindow); + } + + rv = m_logonRedirector->Logon(userName, password, logonRedirectorRequester, nsMsgLogonRedirectionServiceIDs::Imap); } }