fix 130643 can't read imap messages w/o mem cache r=cavin, sr=mscott,sspitzer a=shaver 130616 bad imap password sent to the server multiple times w/o reprompting user r=cavin, sr=sspitzer, a=shaver, 130603 loading messages with images on server w/o other users namespace causes prompt to subscribe to folder r=cavin, sr=sspitzer, a=shaver

This commit is contained in:
bienvenu%netscape.com 2002-03-13 23:39:54 +00:00
parent f969952304
commit a9d6db5667
2 changed files with 15 additions and 7 deletions

View File

@ -6826,6 +6826,7 @@ PRBool nsImapProtocol::TryToLogon()
m_hostSessionList->SetPasswordForHost(GetImapServerKey(), nsnull);
m_currentBiffState = nsIMsgFolder::nsMsgBiffState_Unknown;
SendSetBiffIndicatorEvent(m_currentBiffState);
password.Truncate();
} // if we didn't receive the death signal...
} // if login failed
else // login succeeded
@ -7228,19 +7229,24 @@ nsImapMockChannel::OnCacheEntryAvailable(nsICacheEntryDescriptor *entry, nsCache
// use a stream listener Tee to force data into the cache and to our current channel listener...
nsCOMPtr<nsIStreamListener> newListener;
nsCOMPtr<nsIStreamListenerTee> tee = do_CreateInstance(kStreamListenerTeeCID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsITransport> transport;
rv = entry->GetTransport(getter_AddRefs(transport));
if (NS_FAILED(rv)) return rv;
if (NS_SUCCEEDED(rv))
{
nsCOMPtr<nsIOutputStream> out;
// this will fail with the mem cache turned off, so we need to fall through
// to ReadFromImapConnection instead of aborting with NS_ENSURE_SUCCESS(rv,rv)
rv = transport->OpenOutputStream(0, PRUint32(-1), 0, getter_AddRefs(out));
NS_ENSURE_SUCCESS(rv, rv);
if (NS_SUCCEEDED(rv))
{
rv = tee->Init(m_channelListener, out);
m_channelListener = do_QueryInterface(tee);
NS_ENSURE_SUCCESS(rv, rv);
}
}
}
}
else
{

View File

@ -3429,7 +3429,9 @@ NS_IMETHODIMP nsImapService::NewChannel(nsIURI *aURI, nsIChannel **_retval)
if (aFolder)
aFolder->GetParent(getter_AddRefs(parent));
}
if (!parent && !folderName.IsEmpty())
// if we couldn't get the fullFolderName, then we probably couldn't find
// the other user's namespace, in which case, we shouldn't try to subscribe to it.
if (!parent && !folderName.IsEmpty() && fullFolderName)
{
// this folder doesn't exist - check if the user wants to subscribe to this folder.
nsCOMPtr<nsIPrompt> dialog;