From 573ad960ff96b37cee9efd46ee7f23255f804875 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 22 Jun 1999 23:06:27 +0000 Subject: [PATCH] construct the URI from the server's GetServerURI rather than manually git-svn-id: svn://10.0.0.236/trunk@36382 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/local/src/nsMailboxUrl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mozilla/mailnews/local/src/nsMailboxUrl.cpp b/mozilla/mailnews/local/src/nsMailboxUrl.cpp index 260d89b7e2d..8315749c9ce 100644 --- a/mozilla/mailnews/local/src/nsMailboxUrl.cpp +++ b/mozilla/mailnews/local/src/nsMailboxUrl.cpp @@ -36,6 +36,8 @@ #include "nsMsgDBCID.h" #include "nsIMsgHdr.h" +#include "nsXPIDLString.h" + // we need this because of an egcs 1.0 (and possibly gcc) compiler bug // that doesn't allow you to call ::nsISupports::GetIID() inside of a class // that multiply inherits from nsISupports @@ -97,17 +99,16 @@ static char *nsMailboxGetURI(char *nativepath) // check if filepath begins with serverPath PRInt32 len = PL_strlen(serverPath); if (PL_strncasecmp(serverPath, filePath, len) == 0) { - char *hostname; - rv = server->GetHostName(&hostname); + nsXPIDLCString serverURI; + rv = server->GetServerURI(getter_Copies(serverURI)); if (NS_FAILED(rv)) continue; // the relpath is just past the serverpath char *relpath = nativepath + len; // skip past leading / if any while (*relpath == '/') relpath++; - uri = PR_smprintf("mailbox://%s/%s", hostname, relpath); + uri = PR_smprintf("%s/%s", (const char*)serverURI, relpath); - PL_strfree(hostname); break; } }