From b9cbebd6cae4b1ffc5923addd23820f26a7ce96e Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Wed, 12 Nov 2003 23:10:18 +0000 Subject: [PATCH] fix downloading of truncated pop3 messages when user has changed the server user name, 222896, r/sr=mscott --- mailnews/local/src/nsPop3Service.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mailnews/local/src/nsPop3Service.cpp b/mailnews/local/src/nsPop3Service.cpp index 4a69a83c2fc..ded714748a2 100644 --- a/mailnews/local/src/nsPop3Service.cpp +++ b/mailnews/local/src/nsPop3Service.cpp @@ -374,14 +374,14 @@ NS_IMETHODIMP nsPop3Service::NewChannel(nsIURI *aURI, nsIChannel **_retval) nsCOMPtr url = do_QueryInterface(aURI, &rv); if (NS_SUCCEEDED(rv) && url) { - // GetUsername() returns an escaped username, and the protocol - // stores the username unescaped, so we must unescape the username. - // XXX this is of course very risky since the unescaped string may - // contain embedded nulls as well as characters from some unknown - // charset!! - url->GetUsername(username); - NS_UnescapeURL(username); - protocol->SetUsername(username.get()); + nsXPIDLCString realUserName; + nsCOMPtr server; + url->GetServer(getter_AddRefs(server)); + if (server) + { + server->GetRealUsername(getter_Copies(realUserName)); + protocol->SetUsername(realUserName.get()); + } } rv = protocol->QueryInterface(NS_GET_IID(nsIChannel), (void **) _retval); }