From d7713c0a0d5047a35d883eb4107a9f5861917160 Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Sat, 28 Jun 2003 00:40:08 +0000 Subject: [PATCH] fix problem selecting imap messages after imap uid validity rolls, r/sr=sspitzer 145638 git-svn-id: svn://10.0.0.236/trunk@144238 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/imap/src/nsImapProtocol.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index cc5acc6bfba..ee00e8c08da 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -7753,7 +7753,12 @@ nsresult nsImapMockChannel::OpenCacheEntry() if (folderSink) folderSink->GetUidValidity(&uidValidity); } - return cacheSession->AsyncOpenCacheEntry(urlSpec.get(), nsICache::ACCESS_READ_WRITE, this); + // stick the uid validity in front of the url, so that if the uid validity + // changes, we won't re-use the wrong cache entries. + nsCAutoString cacheKey; + cacheKey.AppendInt(uidValidity, 16); + cacheKey.Append(urlSpec); + return cacheSession->AsyncOpenCacheEntry(cacheKey.get(), nsICache::ACCESS_READ_WRITE, this); } nsresult nsImapMockChannel::ReadFromMemCache(nsICacheEntryDescriptor *entry)