Bug 748865 - TB 12: Message Body not loaded when using "Fetch Headers Only" if message is in a sub-folder. r+a=Standard8
authorDavid Bienvenu <dbienvenu@mozilla.com>
Sat, 28 Apr 2012 14:47:07 +0100
changeset 11281 ca811689a4acf9c56269fe6a7749de95b85eaee8
parent 11280 947483070d725792ae012a64693f482084391ec3
child 11282 9d82860ddf8daf23e6ca96b0c876a7a21e6a238a
push idunknown
push userunknown
push dateunknown
bugs748865
Bug 748865 - TB 12: Message Body not loaded when using "Fetch Headers Only" if message is in a sub-folder. r+a=Standard8
mailnews/local/src/nsPop3Sink.cpp
--- a/mailnews/local/src/nsPop3Sink.cpp
+++ b/mailnews/local/src/nsPop3Sink.cpp
@@ -804,20 +804,21 @@ nsresult nsPop3Sink::HandleTempDownloadF
   }
   return rv;
 }
 
 
 NS_IMETHODIMP
 nsPop3Sink::IncorporateComplete(nsIMsgWindow *aMsgWindow, PRInt32 aSize)
 {
-  if (m_buildMessageUri && !m_baseMessageUri.IsEmpty())
+  if (m_buildMessageUri && !m_baseMessageUri.IsEmpty() && m_newMailParser &&
+      m_newMailParser->m_newMsgHdr)
   {
     PRUint32 msgKey;
-    m_newMailParser->GetEnvelopePos(&msgKey);
+    m_newMailParser->m_newMsgHdr->GetMessageKey(&msgKey);
     m_messageUri.Truncate();
     nsBuildLocalMessageURI(m_baseMessageUri.get(), msgKey, m_messageUri);
   }
 
   nsresult rv = WriteLineToMailbox(MSG_LINEBREAK);
   NS_ENSURE_SUCCESS(rv, rv);
   bool leaveOnServer = false;
   m_popServer->GetLeaveMessagesOnServer(&leaveOnServer);