diff --git a/mozilla/mailnews/imap/src/Makefile.in b/mozilla/mailnews/imap/src/Makefile.in index 8198a5362de..433e8f61d79 100644 --- a/mozilla/mailnews/imap/src/Makefile.in +++ b/mozilla/mailnews/imap/src/Makefile.in @@ -74,6 +74,7 @@ REQUIRES = xpcom \ uriloader \ windowwatcher \ embed_base \ + exthandler \ $(NULL) EXPORTS = \ diff --git a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp index 5a80a29b236..07b4e2cd773 100644 --- a/mozilla/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mozilla/mailnews/imap/src/nsImapMailFolder.cpp @@ -117,6 +117,8 @@ #include "nsIMsgIdentity.h" #include "nsIMsgFolderNotificationService.h" #include "nsNativeCharsetUtils.h" +#include "nsIExternalProtocolService.h" +#include "nsCExternalHandlerService.h" static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID); static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID); @@ -3443,15 +3445,23 @@ NS_IMETHODIMP nsImapMailFolder::FolderPrivileges(nsIMsgWindow *window) #endif if (!m_adminUrl.IsEmpty()) { - nsCOMPtr docShell; - rv = window->GetRootDocShell(getter_AddRefs(docShell)); - if (NS_SUCCEEDED(rv) && docShell) + nsCOMPtr extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID); + if (extProtService) { + nsCAutoString scheme; nsCOMPtr uri; if (NS_FAILED(rv = NS_NewURI(getter_AddRefs(uri), m_adminUrl.get()))) return rv; - rv = docShell->LoadURI(uri, nsnull, nsIWebNavigation::LOAD_FLAGS_IS_LINK, PR_FALSE); - + uri->GetScheme(scheme); + if (!scheme.IsEmpty()) + { + // if the URL scheme does not correspond to an exposed protocol, then we + // need to hand this link click over to the external protocol handler. + PRBool isExposed; + rv = extProtService->IsExposedProtocol(scheme.get(), &isExposed); + if (NS_SUCCEEDED(rv) && !isExposed) + return extProtService->LoadUrl(uri); + } } } else