mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 11:26:09 +00:00
fix handling of online sub directories with imap namespaces, r/sr=mscott 219645
This commit is contained in:
parent
ca61354c26
commit
4a0a6e3ea0
@ -862,15 +862,20 @@ NS_IMETHODIMP nsImapUrl::AddOnlineDirectoryIfNecessary(const char *onlineMailbox
|
||||
}
|
||||
if (ns && (PL_strlen(ns->GetPrefix()) != 0) && !onlineDirWithDelimiter.Equals(ns->GetPrefix()))
|
||||
{
|
||||
// The namespace for this mailbox is the root ("").
|
||||
// Prepend the online server directory
|
||||
int finalLen = onlineDirWithDelimiter.Length() +
|
||||
strlen(onlineMailboxName) + 1;
|
||||
newOnlineName = (char *)PR_Malloc(finalLen);
|
||||
if (newOnlineName)
|
||||
// check that onlineMailboxName doesn't start with the namespace. If that's the case,
|
||||
// we don't want to prepend the online dir.
|
||||
if (PL_strncmp(onlineMailboxName, ns->GetPrefix(), PL_strlen(ns->GetPrefix())))
|
||||
{
|
||||
PL_strcpy(newOnlineName, onlineDirWithDelimiter.get());
|
||||
PL_strcat(newOnlineName, onlineMailboxName);
|
||||
// The namespace for this mailbox is the root ("").
|
||||
// Prepend the online server directory
|
||||
int finalLen = onlineDirWithDelimiter.Length() +
|
||||
strlen(onlineMailboxName) + 1;
|
||||
newOnlineName = (char *)PR_Malloc(finalLen);
|
||||
if (newOnlineName)
|
||||
{
|
||||
PL_strcpy(newOnlineName, onlineDirWithDelimiter.get());
|
||||
PL_strcat(newOnlineName, onlineMailboxName);
|
||||
}
|
||||
}
|
||||
}
|
||||
// just prepend the online server directory if it doesn't start with it already
|
||||
|
Loading…
Reference in New Issue
Block a user