fix for problem failing to delete imap messages when user has a server that supports acl and changes his username, r/sr/a=sspitzer 63550

This commit is contained in:
bienvenu%netscape.com 2003-05-14 00:52:16 +00:00
Родитель 0800459251
Коммит 28714d3d31
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -5258,7 +5258,16 @@ const char *nsMsgIMAPFolderACL::GetRightsStringForUser(const char *inUserName)
nsXPIDLCString userName;
userName.Assign(inUserName);
if (!userName.Length())
m_folder->GetUsername(getter_Copies(userName));
{
nsCOMPtr <nsIMsgIncomingServer> server;
nsresult rv = m_folder->GetServer(getter_AddRefs(server));
NS_ASSERTION(NS_SUCCEEDED(rv), "error getting server");
if (NS_FAILED(rv)) return nsnull;
// we need the real user name to match with what the imap server returns
// in the acl response.
server->GetRealUsername(getter_Copies(userName));
}
nsCStringKey userKey(userName.get());
return (const char *)m_rightsHash->Get(&userKey);