fix problems with imap subscribe ui and cyrus servers, r/sr=sspitzer, 202622

This commit is contained in:
bienvenu%netscape.com 2003-06-05 03:36:27 +00:00
Родитель e91e7735da
Коммит 192c331ec4
4 изменённых файлов: 12 добавлений и 8 удалений

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

@ -712,7 +712,7 @@ nsImapIncomingServer::CreateImapConnection(nsIEventQueue *aEventQueue,
else
{
rv = connection->CanHandleUrl(aImapUrl, &canRunUrlImmediately, &canRunButBusy);
#ifdef DEBUG_bienvenu1
#ifdef DEBUG_bienvenu
nsXPIDLCString curSelectedFolderName;
if (connection)
connection->GetSelectedMailboxName(getter_Copies(curSelectedFolderName));
@ -1145,6 +1145,7 @@ NS_IMETHODIMP nsImapIncomingServer::PossibleImapMailbox(const char *folderPath,
rv = a_nsIFolder->FindSubFolder(folderPath, getter_AddRefs(subFolder));
NS_ENSURE_SUCCESS(rv,rv);
msgFolder = do_QueryInterface(subFolder, &rv);
m_subscribeFolders.AppendObject(msgFolder);
NS_ENSURE_SUCCESS(rv,rv);
noSelect = (boxFlags & kNoselect) != 0;
nsCOMPtr<nsIMsgImapMailFolder> imapFolder = do_QueryInterface(msgFolder, &rv);
@ -3056,6 +3057,7 @@ NS_IMETHODIMP
nsImapIncomingServer::SubscribeCleanup()
{
nsresult rv;
m_subscribeFolders.Clear();
rv = ClearInner();
NS_ENSURE_SUCCESS(rv,rv);
return NS_OK;

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

@ -49,7 +49,7 @@
#include "nsISubscribableServer.h"
#include "nsIUrlListener.h"
#include "nsAdapterEnumerator.h"
#include "nsCOMArray.h"
/* get some implementation from nsMsgIncomingServer */
class nsImapIncomingServer : public nsMsgIncomingServer,
public nsIImapIncomingServer,
@ -131,6 +131,7 @@ private:
nsCOMPtr<nsISupportsArray> m_connectionCache;
nsCOMPtr<nsISupportsArray> m_urlQueue;
nsCOMPtr<nsIStringBundle> m_stringBundle;
nsCOMArray<nsIMsgFolder> m_subscribeFolders; // used to keep folder resources around while subscribe UI is up.
nsVoidArray m_urlConsumers;
PRUint32 m_capability;
nsCString m_manageMailAccountUrl;

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

@ -1691,7 +1691,8 @@ NS_IMETHODIMP nsImapMailFolder::ReadFromFolderCacheElem(nsIMsgFolderCacheElement
nsXPIDLCString onlineName;
element->GetInt32Property("boxFlags", &m_boxFlags);
if (NS_SUCCEEDED(element->GetInt32Property("hierDelim", &hierarchyDelimiter)))
if (NS_SUCCEEDED(element->GetInt32Property("hierDelim", &hierarchyDelimiter))
&& hierarchyDelimiter != kOnlineHierarchySeparatorUnknown)
m_hierarchyDelimiter = (PRUnichar) hierarchyDelimiter;
rv = element->GetStringProperty("onlineName", getter_Copies(onlineName));
if (NS_SUCCEEDED(rv) && (const char *) onlineName && strlen((const char *) onlineName))

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

@ -1184,7 +1184,7 @@ nsImapService::CreateStartOfImapUrl(const char * aImapURI, nsIImapUrl ** imapUrl
rv = aImapMailFolder->GetUsername(getter_Copies(username));
if (NS_FAILED(rv))
{
PR_FREEIF(hostname);
PR_Free(hostname);
return rv;
}
@ -1234,7 +1234,7 @@ nsImapService::CreateStartOfImapUrl(const char * aImapURI, nsIImapUrl ** imapUrl
imapFolder->GetHierarchyDelimiter(&hierarchyDelimiter);
}
PR_FREEIF(hostname);
PR_Free(hostname);
return rv;
}
@ -3694,12 +3694,12 @@ nsImapService::GetListOfFoldersOnServer(nsIImapIncomingServer *aServer, nsIMsgWi
NS_IMETHODIMP
nsImapService::SubscribeFolder(nsIEventQueue* eventQueue,
nsIMsgFolder* aFolder,
const PRUnichar* folderName,
const PRUnichar* aFolderName,
nsIUrlListener* urlListener, nsIURI** url)
{
NS_ENSURE_ARG_POINTER(eventQueue);
NS_ENSURE_ARG_POINTER(aFolder);
NS_ENSURE_ARG_POINTER(folderName);
NS_ENSURE_ARG_POINTER(aFolderName);
nsCOMPtr<nsIImapUrl> imapUrl;
nsCAutoString urlSpec;
@ -3716,7 +3716,7 @@ nsImapService::SubscribeFolder(nsIEventQueue* eventQueue,
urlSpec.Append("/subscribe>");
urlSpec.Append(char(hierarchySeparator));
char *utfFolderName =
CreateUtf7ConvertedStringFromUnicode(folderName);
CreateUtf7ConvertedStringFromUnicode(aFolderName);
char *escapedFolderName = nsEscape(utfFolderName, url_Path);
urlSpec.Append(escapedFolderName);
nsCRT::free(escapedFolderName);