fix downloading of imap messages for offline use when reading if mime parts on demand is invoked r=naving, sr=mscott 11067

git-svn-id: svn://10.0.0.236/trunk@108246 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%netscape.com 2001-11-16 02:32:05 +00:00
parent fc6b6ceee3
commit c9a006a2f9

View File

@ -684,15 +684,6 @@ NS_IMETHODIMP nsImapService::DisplayMessage(const char* aMessageURI,
PRBool shouldStoreMsgOffline = PR_FALSE;
PRBool hasMsgOffline = PR_FALSE;
if (folder)
{
folder->ShouldStoreMsgOffline(key, &shouldStoreMsgOffline);
folder->HasMsgOffline(key, &hasMsgOffline);
}
if (imapMessageSink)
imapMessageSink->SetNotifyDownloadedLines(shouldStoreMsgOffline);
nsCOMPtr<nsIMsgIncomingServer> aMsgIncomingServer;
if (imapMessageSink)
@ -721,6 +712,12 @@ NS_IMETHODIMP nsImapService::DisplayMessage(const char* aMessageURI,
useMimePartsOnDemand = PR_FALSE;
}
if (folder)
{
folder->ShouldStoreMsgOffline(key, &shouldStoreMsgOffline);
folder->HasMsgOffline(key, &hasMsgOffline);
}
if (!useMimePartsOnDemand || (messageSize < (uint32) gMIMEOnDemandThreshold))
// allowedToBreakApart &&
// !GetShouldFetchAllParts() &&
@ -734,8 +731,12 @@ NS_IMETHODIMP nsImapService::DisplayMessage(const char* aMessageURI,
{
// whenever we are displaying a message, we want to add it to the memory cache..
imapUrl->SetFetchPartsOnDemand(PR_TRUE);
shouldStoreMsgOffline = PR_FALSE; // if we're fetching by parts, don't store offline
msgurl->SetAddToMemoryCache(PR_FALSE);
}
if (imapMessageSink)
imapMessageSink->SetNotifyDownloadedLines(shouldStoreMsgOffline);
PRBool msgLoadingFromCache = PR_FALSE;
if (hasMsgOffline)
msgurl->SetMsgIsInLocalCache(PR_TRUE);