From 5a0c65dc76e0726b5e7950d1b71560abe32e4e31 Mon Sep 17 00:00:00 2001 From: "bryner%uiuc.edu" Date: Sat, 3 Feb 2001 02:59:01 +0000 Subject: [PATCH] Bug 67412 - set the NotificationCallbacks object on the imap channel so that PSM can get its nsIPrompt. r=jag, sr=mscott. git-svn-id: svn://10.0.0.236/trunk@86143 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/imap/src/nsImapProtocol.cpp | 5 +++++ mozilla/mailnews/imap/src/nsImapUrl.cpp | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) 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; }