diff --git a/mailnews/base/public/nsIMsgMailNewsUrl.idl b/mailnews/base/public/nsIMsgMailNewsUrl.idl index 7981e579d63..425db3996fb 100644 --- a/mailnews/base/public/nsIMsgMailNewsUrl.idl +++ b/mailnews/base/public/nsIMsgMailNewsUrl.idl @@ -63,6 +63,7 @@ interface nsIMsgMailNewsUrl : nsIURL { void RegisterListener (in nsIUrlListener aUrlListener); void UnRegisterListener (in nsIUrlListener aUrlListener); + readonly attribute nsIURI baseURI; // Eventually this will be removed and replaced with calls to nsIMsgStatusFeedback attribute string errorMessage; diff --git a/mailnews/base/util/nsMsgMailNewsUrl.cpp b/mailnews/base/util/nsMsgMailNewsUrl.cpp index c33655412a8..b05dc75f317 100644 --- a/mailnews/base/util/nsMsgMailNewsUrl.cpp +++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp @@ -554,9 +554,25 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetOriginCharset(nsACString &aOriginCharset) return m_baseURL->GetOriginCharset(aOriginCharset); } +NS_IMETHODIMP nsMsgMailNewsUrl::GetBaseURI(nsIURI **aBaseURI) +{ + NS_ENSURE_ARG_POINTER(aBaseURI); + return m_baseURL->QueryInterface(NS_GET_IID(nsIURI), (void**) aBaseURI); +} + NS_IMETHODIMP nsMsgMailNewsUrl::Equals(nsIURI *other, PRBool *_retval) { - return m_baseURL->Equals(other, _retval); + nsCOMPtr mailUrl = do_QueryInterface(other); + // we really want to compare the base uris to each other, not our base URI + // with the other's real URI. + if (mailUrl) + { + nsCOMPtr baseURI; + mailUrl->GetBaseURI(getter_AddRefs(baseURI)); + if (baseURI) + return m_baseURL->Equals(baseURI, _retval); + } + return m_baseURL->Equals(other, _retval); } NS_IMETHODIMP nsMsgMailNewsUrl::SchemeIs(const char *aScheme, PRBool *_retval)