fix difference in url escaping between imap folder uri's and content policy uris for message display, which was causing problems displaying images in imap messages r/sr=neil, 450332
authorDavid Bienvenu <bienvenu@nventure.com>
Mon, 18 Aug 2008 07:41:14 -0700
changeset 130 d4c1ad6539682e68d4d4c6b281660b00fbfca613
parent 129 13eae6fc3733db9c5a6b0f290dd703930bb57975
child 133 477d7ede8e4015ed8d4535c31fbe4e8a0882e585
push idunknown
push userunknown
push dateunknown
bugs450332
fix difference in url escaping between imap folder uri's and content policy uris for message display, which was causing problems displaying images in imap messages r/sr=neil, 450332
mailnews/imap/src/nsImapUrl.cpp
mailnews/imap/src/nsImapUrl.h
--- a/mailnews/imap/src/nsImapUrl.cpp
+++ b/mailnews/imap/src/nsImapUrl.cpp
@@ -1176,16 +1176,29 @@ NS_IMETHODIMP nsImapUrl::SetMockChannel(
 
 NS_IMETHODIMP nsImapUrl::GetAllowContentChange(PRBool *result)
 {
   NS_ENSURE_ARG_POINTER(result);
   *result = m_allowContentChange;
   return NS_OK;
 }
 
+NS_IMETHODIMP nsImapUrl::Clone(nsIURI **_retval)
+{
+  nsresult rv = nsMsgMailNewsUrl::Clone(_retval);
+  NS_ENSURE_SUCCESS(rv, rv);
+  // also clone the mURI member, because GetUri below won't work if
+  // mURI isn't set due to escaping issues.
+  nsCOMPtr <nsIMsgMessageUrl> clonedUrl = do_QueryInterface(*_retval);
+  if (clonedUrl)
+    clonedUrl->SetUri(mURI.get());
+  return rv;
+}
+
+
 NS_IMETHODIMP nsImapUrl::SetUri(const char * aURI)
 {
   mURI= aURI;
   return NS_OK;
 }
 
 NS_IMETHODIMP nsImapUrl::GetUri(char** aURI)
 {
--- a/mailnews/imap/src/nsImapUrl.h
+++ b/mailnews/imap/src/nsImapUrl.h
@@ -54,16 +54,17 @@ class nsImapUrl : public nsIImapUrl, pub
 {
 public:
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsIURI override
   NS_IMETHOD SetSpec(const nsACString &aSpec);
   NS_IMETHOD SetQuery(const nsACString &aQuery);
+  NS_IMETHOD Clone(nsIURI **_retval);
 
   //////////////////////////////////////////////////////////////////////////////
   // we support the nsIImapUrl interface
   //////////////////////////////////////////////////////////////////////////////
   NS_DECL_NSIIMAPURL
 
   // nsIMsgMailNewsUrl overrides
   NS_IMETHOD IsUrlType(PRUint32 type, PRBool *isType);