From 95110e872599bccf183e21106940f0d7a0c19af3 Mon Sep 17 00:00:00 2001 From: "varada%netscape.com" Date: Fri, 16 Nov 2001 20:51:54 +0000 Subject: [PATCH] [sspitzer checking in as varada] fix for smoketest blocker #110478. reply to local messages fails to quote the message. calling SetSpec() on a spec with a query string causes problems. see #110508 but to fix the blocker, I've rewritten the code to use SetQuery(), which is better anyways. r=ducarroz git-svn-id: svn://10.0.0.236/trunk@108324 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/compose/src/nsMsgQuote.cpp | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/mozilla/mailnews/compose/src/nsMsgQuote.cpp b/mozilla/mailnews/compose/src/nsMsgQuote.cpp index be872fd37d1..ac26ec596b4 100644 --- a/mozilla/mailnews/compose/src/nsMsgQuote.cpp +++ b/mozilla/mailnews/compose/src/nsMsgQuote.cpp @@ -194,25 +194,22 @@ nsMsgQuote::QuoteMessage(const char *msgURI, PRBool quoteHeaders, nsIStreamListe rv = msgService->GetUrlForUri(msgURI, getter_AddRefs(aURL), nsnull); if (NS_FAILED(rv)) return rv; - // now we want to append some quote specific information to the - // end of the url spec. - nsXPIDLCString urlSpec; - aURL->GetSpec(getter_Copies(urlSpec)); - nsCAutoString modifiedUrlSpec(urlSpec); - PRBool bAutoQuote = PR_TRUE; nsCOMPtr prefs(do_GetService(kPrefCID, &rv)); if (NS_SUCCEEDED(rv)) prefs->GetBoolPref("mail.auto_quote", &bAutoQuote); - if (! bAutoQuote) /* We don't need to quote the message body but we still need to extract the headers */ - modifiedUrlSpec += "?header=only"; - else if (quoteHeaders) - modifiedUrlSpec += "?header=quote"; - else - modifiedUrlSpec += "?header=quotebody"; + nsCOMPtr mailNewsUrl = do_QueryInterface(aURL, &rv); + NS_ENSURE_SUCCESS(rv,rv); - aURL->SetSpec(modifiedUrlSpec.get()); + if (! bAutoQuote) /* We don't need to quote the message body but we still need to extract the headers */ + rv = mailNewsUrl->SetQuery("header=only"); + else if (quoteHeaders) + rv = mailNewsUrl->SetQuery("header=quote"); + else + rv = mailNewsUrl->SetQuery("header=quotebody"); + + NS_ENSURE_SUCCESS(rv,rv); // if we were given a non empty charset, then use it if (aMsgCharSet && *aMsgCharSet)