From 1237e0a5d0ec3d81b21b3ff41d5928447ffc0344 Mon Sep 17 00:00:00 2001 From: "bienvenu%netscape.com" Date: Sun, 9 Jan 2000 23:38:52 +0000 Subject: [PATCH] hook up load group for msg protocol so stop will work, r=mscott --- mailnews/base/util/nsMsgProtocol.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mailnews/base/util/nsMsgProtocol.cpp b/mailnews/base/util/nsMsgProtocol.cpp index edbd6b9d931f..25511b6f9cfd 100644 --- a/mailnews/base/util/nsMsgProtocol.cpp +++ b/mailnews/base/util/nsMsgProtocol.cpp @@ -177,7 +177,13 @@ NS_IMETHODIMP nsMsgProtocol::OnStartRequest(nsIChannel * aChannel, nsISupports * nsresult rv = NS_OK; nsCOMPtr aMsgUrl = do_QueryInterface(ctxt, &rv); if (NS_SUCCEEDED(rv) && aMsgUrl) + { rv = aMsgUrl->SetUrlState(PR_TRUE, NS_OK); + nsCOMPtr loadGroup; + aMsgUrl->GetLoadGroup(getter_AddRefs(loadGroup)); + if (loadGroup) + loadGroup->AddChannel(aChannel, nsnull /* context isupports */); + } // if we are set up as a channel, we should notify our channel listener that we are starting... // so pass in ourself as the channel and not the underlying socket or file channel the protocol @@ -194,8 +200,13 @@ NS_IMETHODIMP nsMsgProtocol::OnStopRequest(nsIChannel * aChannel, nsISupports *c nsresult rv = NS_OK; nsCOMPtr aMsgUrl = do_QueryInterface(ctxt, &rv); if (NS_SUCCEEDED(rv) && aMsgUrl) + { rv = aMsgUrl->SetUrlState(PR_FALSE, aStatus); - + nsCOMPtr loadGroup; + aMsgUrl->GetLoadGroup(getter_AddRefs(loadGroup)); + if (loadGroup) + loadGroup->RemoveChannel(aChannel, nsnull, aStatus, nsnull); + } // if we are set up as a channel, we should notify our channel listener that we are starting... // so pass in ourself as the channel and not the underlying socket or file channel the protocol // happens to be using