fix handling of special folder uri's in case the online server directory is the same as the imap namespace modulo a trailing delimiter, r=ssptizer, sr=mscott, a=sspitzer 214962

This commit is contained in:
bienvenu%nventure.com 2003-09-03 16:28:16 +00:00
Родитель 545a62fca9
Коммит b99fd170c5
1 изменённых файлов: 14 добавлений и 0 удалений

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

@ -3705,6 +3705,20 @@ nsImapIncomingServer::GetUriWithNamespacePrefixIfNecessary(PRInt32 namespaceType
nsCAutoString namespacePrefix(ns->GetPrefix());
if (!namespacePrefix.IsEmpty())
{
// check if namespacePrefix is the same as the online directory; if so, ignore it.
nsXPIDLCString onlineDir;
rv = GetServerDirectory(getter_Copies(onlineDir));
NS_ENSURE_SUCCESS(rv, rv);
if (!onlineDir.IsEmpty())
{
char delimiter = ns->GetDelimiter();
if ( onlineDir.Last() != delimiter )
onlineDir += delimiter;
if (onlineDir.Equals(namespacePrefix))
return NS_OK;
}
namespacePrefix.ReplaceChar(ns->GetDelimiter(), '/'); // use canonical format
nsCAutoString resultUri(originalUri);
PRInt32 index = resultUri.Find("//"); // find scheme