fix problems with biff and cleanup inbox on exit with SSL, r=naving, sr=mscott 90767 58964

This commit is contained in:
bienvenu%netscape.com 2001-07-18 13:51:27 +00:00
Родитель 4e6d8584d7
Коммит 04dd6715b8
4 изменённых файлов: 44 добавлений и 31 удалений

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

@ -918,12 +918,16 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
if (folder)
{
nsXPIDLCString passwd;
PRBool serverRequiresPasswordForAuthentication = PR_TRUE;
PRBool isImap = (type ? PL_strcmp(type, "imap") == 0 :
PR_FALSE);
if (isImap)
{
server->GetServerRequiresPasswordForBiff(&serverRequiresPasswordForAuthentication);
server->GetPassword(getter_Copies(passwd));
if (!isImap || (isImap && passwd &&
nsCRT::strlen((const char*) passwd)))
}
if (!isImap || (isImap && (!serverRequiresPasswordForAuthentication || (passwd &&
nsCRT::strlen((const char*) passwd)))))
{
nsCOMPtr<nsIUrlListener> urlListener;
NS_WITH_SERVICE(nsIMsgAccountManager, accountManager,
@ -979,7 +983,7 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
{
accountManager->GetCleanupInboxInProgress(&inProgress);
PR_CEnterMonitor(folder);
PR_CWait(folder, 1000UL);
PR_CWait(folder, PR_MicrosecondsToInterval(1000UL));
PR_CExitMonitor(folder);
if (eventQueue)
eventQueue->ProcessPendingEvents();
@ -992,7 +996,7 @@ PRBool PR_CALLBACK nsMsgAccountManager::cleanupOnExit(nsHashKey *aKey, void *aDa
{
accountManager->GetEmptyTrashInProgress(&inProgress);
PR_CEnterMonitor(folder);
PR_CWait(folder, 1000UL);
PR_CWait(folder, PR_MicrosecondsToInterval(1000UL));
PR_CExitMonitor(folder);
if (eventQueue)
eventQueue->ProcessPendingEvents();

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

@ -46,7 +46,7 @@ interface nsIImapServerSink : nsISupports {
void fEAlertFromServer(in string aString, in nsIMsgWindow aMsgWindow);
void commitNamespaces();
void promptForPassword(out string aString, in nsIMsgWindow aMsgWindow);
void setUserAuthenticated(in boolean authenticated);
attribute boolean userAuthenticated;
void setMailServerUrls(in string manageMailAccount, in string manageLists, in string manageFilters);
/* this is a bogus method on this interface but i need it until misc. sink is scriptable.. */

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

@ -96,16 +96,17 @@ NS_INTERFACE_MAP_END_INHERITING(nsMsgIncomingServer)
nsImapIncomingServer::nsImapIncomingServer()
{
NS_INIT_REFCNT();
nsresult rv;
rv = NS_NewISupportsArray(getter_AddRefs(m_connectionCache));
rv = NS_NewISupportsArray(getter_AddRefs(m_urlQueue));
m_capability = kCapabilityUndefined;
m_waitingForConnectionInfo = PR_FALSE;
m_redirectedLogonRetries = 0;
mDoingSubscribeDialog = PR_FALSE;
mDoingLsub = PR_FALSE;
m_canHaveFilters = PR_TRUE;
NS_INIT_REFCNT();
nsresult rv;
rv = NS_NewISupportsArray(getter_AddRefs(m_connectionCache));
rv = NS_NewISupportsArray(getter_AddRefs(m_urlQueue));
m_capability = kCapabilityUndefined;
m_waitingForConnectionInfo = PR_FALSE;
m_redirectedLogonRetries = 0;
mDoingSubscribeDialog = PR_FALSE;
mDoingLsub = PR_FALSE;
m_canHaveFilters = PR_TRUE;
m_userAuthenticated = PR_FALSE;
m_readPFCName = PR_FALSE;
}
@ -2143,6 +2144,15 @@ nsresult nsImapIncomingServer::GetUnverifiedSubFolders(nsIFolder *parentFolder,
return rv;
}
NS_IMETHODIMP nsImapIncomingServer::GetServerRequiresPasswordForBiff(PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
// if the user has already been authenticated, we've got the password
*_retval = !m_userAuthenticated;
return NS_OK;
}
NS_IMETHODIMP nsImapIncomingServer::PromptForPassword(char ** aPassword,
nsIMsgWindow * aMsgWindow)
{
@ -2283,10 +2293,7 @@ void MSG_IMAPFolderInfoMail::ResetNamespaceReferences()
#endif //FINISHED_PORTED_NAMESPACE_STUFF
NS_IMETHODIMP nsImapIncomingServer::SetUserAuthenticated(PRBool authenticated)
{
return NS_OK;
}
NS_IMPL_GETSET(nsImapIncomingServer, UserAuthenticated, PRBool, m_userAuthenticated);
/* void SetMailServerUrls (in string manageMailAccount, in string manageLists, in string manageFilters); */
NS_IMETHODIMP nsImapIncomingServer::SetMailServerUrls(const char *manageMailAccount, const char *manageLists, const char *manageFilters)

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

@ -71,6 +71,7 @@ public:
NS_IMETHOD GetCanFileMessagesOnServer(PRBool *aCanFileMessagesOnServer);
NS_IMETHOD GetFilterScope(nsMsgSearchScopeValue *filterScope);
NS_IMETHOD GetSearchScope(nsMsgSearchScopeValue *searchScope);
NS_IMETHOD GetServerRequiresPasswordForBiff(PRBool *_retval);
protected:
nsresult GetFolder(const char* name, nsIMsgFolder** pFolder);
nsresult ResetFoldersToUnverified(nsIFolder *parentFolder);
@ -101,21 +102,22 @@ private:
nsCOMPtr<nsISupportsArray> m_connectionCache;
nsCOMPtr<nsISupportsArray> m_urlQueue;
nsCOMPtr<nsIStringBundle> m_stringBundle;
nsVoidArray m_urlConsumers;
PRUint32 m_capability;
nsCString m_manageMailAccountUrl;
nsVoidArray m_urlConsumers;
PRUint32 m_capability;
nsCString m_manageMailAccountUrl;
PRBool m_readPFCName;
PRBool m_userAuthenticated;
nsCString m_pfcName;
PRBool m_waitingForConnectionInfo;
PRInt32 m_redirectedLogonRetries;
nsCOMPtr<nsIMsgLogonRedirector> m_logonRedirector;
// subscribe dialog stuff
PRBool mDoingSubscribeDialog;
PRBool mDoingLsub;
nsresult AddFolderToSubscribeDialog(const char *parentUri, const char *uri,const char *folderName);
PRBool m_waitingForConnectionInfo;
PRInt32 m_redirectedLogonRetries;
nsCOMPtr<nsIMsgLogonRedirector> m_logonRedirector;
// subscribe dialog stuff
PRBool mDoingSubscribeDialog;
PRBool mDoingLsub;
nsresult AddFolderToSubscribeDialog(const char *parentUri, const char *uri,const char *folderName);
nsCOMPtr <nsISubscribableServer> mInner;
nsCOMPtr <nsISubscribableServer> mInner;
nsresult EnsureInner();
nsresult ClearInner();
};