diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 39497c7dfc7..6ab505dd8a7 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -613,6 +613,11 @@ nsresult nsImapProtocol::SetupWithUrl(nsIURI * aURL, nsISupports* aConsumer) m_channel->GetSecurityInfo(getter_AddRefs(securityInfo)); m_mockChannel->SetSecurityInfo(securityInfo); + // Copy over the notification callbacks object from the mock channel + nsCOMPtr callbacks; + m_mockChannel->GetNotificationCallbacks(getter_AddRefs(callbacks)); + m_channel->SetNotificationCallbacks(callbacks); + // and if we have a cache entry that we are saving the message to, set the security info on it too. // since imap only uses the memory cache, passing this on is the right thing to do. nsCOMPtr mailnewsUrl = do_QueryInterface(m_runningUrl); diff --git a/mozilla/mailnews/imap/src/nsImapUrl.cpp b/mozilla/mailnews/imap/src/nsImapUrl.cpp index e3d39737e71..42658b31dd6 100644 --- a/mozilla/mailnews/imap/src/nsImapUrl.cpp +++ b/mozilla/mailnews/imap/src/nsImapUrl.cpp @@ -48,6 +48,8 @@ #include "rdf.h" #include "nsIMsgFolder.h" #include "nsIMessage.h" +#include "nsIDocShell.h" +#include "nsIInterfaceRequestor.h" static NS_DEFINE_CID(kCImapMockChannel, NS_IMAPMOCKCHANNEL_CID); @@ -98,8 +100,15 @@ NS_IMETHODIMP nsImapUrl::SetMsgWindow(nsIMsgWindow *aMsgWindow) if (aMsgWindow) { m_msgWindow = do_QueryInterface(aMsgWindow); - if (m_mockChannel) + if (m_mockChannel) { m_mockChannel->SetURI(this); + nsCOMPtr msgDocShell; + m_msgWindow->GetRootDocShell(getter_AddRefs(msgDocShell)); + if (msgDocShell) { + nsCOMPtr docIR(do_QueryInterface(msgDocShell)); + m_mockChannel->SetNotificationCallbacks(docIR); + } + } } return NS_OK; }