зеркало из https://github.com/mozilla/pjs.git
fix 303571, can't move folder to root of imap hiearchy unless the hierarchy delimiter is /, also remove unused code sr=mscott
This commit is contained in:
Родитель
9a41e110e1
Коммит
dc14ee6579
|
@ -124,8 +124,6 @@ public:
|
|||
|
||||
|
||||
// Hierarchy Delimiters
|
||||
NS_IMETHOD AddHierarchyDelimiter(const char *serverKey, char delimiter) = 0;
|
||||
NS_IMETHOD GetHierarchyDelimiterStringForHost(const char *serverKey, nsString &result) = 0;
|
||||
NS_IMETHOD SetNamespaceHierarchyDelimiterFromMailboxForHost(const char *serverKey, const char *boxName, char delimiter) = 0;
|
||||
|
||||
// Message Body Shells
|
||||
|
|
|
@ -344,36 +344,6 @@ NS_IMETHODIMP nsIMAPHostSessionList::SetGotNamespacesForHost(
|
|||
return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsIMAPHostSessionList::GetHierarchyDelimiterStringForHost(const char *serverKey, nsString &result)
|
||||
{
|
||||
PR_EnterMonitor(gCachedHostInfoMonitor);
|
||||
nsIMAPHostInfo *host = FindHost(serverKey);
|
||||
if (host)
|
||||
result.AssignWithConversion(host->fHierarchyDelimiters);
|
||||
PR_ExitMonitor(gCachedHostInfoMonitor);
|
||||
return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsIMAPHostSessionList::AddHierarchyDelimiter(const char *serverKey, char delimiter)
|
||||
{
|
||||
PR_EnterMonitor(gCachedHostInfoMonitor);
|
||||
nsIMAPHostInfo *host = FindHost(serverKey);
|
||||
if (host)
|
||||
{
|
||||
if (!host->fHierarchyDelimiters)
|
||||
{
|
||||
host->fHierarchyDelimiters = PR_smprintf("%c",delimiter);
|
||||
}
|
||||
else if (!PL_strchr(host->fHierarchyDelimiters, delimiter))
|
||||
{
|
||||
char *tmpDelimiters = PR_smprintf("%s%c",host->fHierarchyDelimiters,delimiter);
|
||||
PR_FREEIF(host->fHierarchyDelimiters);
|
||||
host->fHierarchyDelimiters = tmpDelimiters;
|
||||
}
|
||||
}
|
||||
PR_ExitMonitor(gCachedHostInfoMonitor);
|
||||
return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsIMAPHostSessionList::GetHostIsUsingSubscription(const char *serverKey, PRBool &result)
|
||||
{
|
||||
|
|
|
@ -152,8 +152,6 @@ public:
|
|||
NS_IMETHOD FlushUncommittedNamespacesForHost(const char *serverKey, PRBool &result);
|
||||
|
||||
// Hierarchy Delimiters
|
||||
NS_IMETHOD AddHierarchyDelimiter(const char *serverKey, char delimiter);
|
||||
NS_IMETHOD GetHierarchyDelimiterStringForHost(const char *serverKey, nsString &result);
|
||||
NS_IMETHOD SetNamespaceHierarchyDelimiterFromMailboxForHost(const char *serverKey, const char *boxName, char delimiter);
|
||||
|
||||
// Message Body Shells
|
||||
|
|
|
@ -1156,9 +1156,21 @@ NS_IMETHODIMP nsImapMailFolder::SetHierarchyDelimiter(PRUnichar aHierarchyDelimi
|
|||
|
||||
NS_IMETHODIMP nsImapMailFolder::GetHierarchyDelimiter(PRUnichar *aHierarchyDelimiter)
|
||||
{
|
||||
if (!aHierarchyDelimiter)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
ReadDBFolderInfo(PR_FALSE); // update cache first.
|
||||
NS_ENSURE_ARG_POINTER(aHierarchyDelimiter);
|
||||
if (mIsServer)
|
||||
{
|
||||
// if it's the root folder, we don't know the delimiter. So look at the
|
||||
// first child.
|
||||
PRUint32 count = 0;
|
||||
(void) mSubFolders->Count(&count);
|
||||
if (count > 0)
|
||||
{
|
||||
nsCOMPtr<nsIMsgImapMailFolder> childFolder = do_QueryElementAt(mSubFolders, 0);
|
||||
if (childFolder)
|
||||
return childFolder->GetHierarchyDelimiter(aHierarchyDelimiter);
|
||||
}
|
||||
}
|
||||
ReadDBFolderInfo(PR_FALSE); // update cache first.
|
||||
*aHierarchyDelimiter = m_hierarchyDelimiter;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче