fix for #39913, no you can subscribe / unsubscribe from imap folders with japanese folder

names.  r=mscott
This commit is contained in:
sspitzer%netscape.com 2000-05-20 02:36:30 +00:00
Родитель ad545fe55f
Коммит 4973834992
4 изменённых файлов: 16 добавлений и 27 удалений

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

@ -45,7 +45,7 @@ interface nsISubscribableServer : nsISupports {
void addToSubscribeDS(in string aName);
void setAsSubscribedInSubscribeDS(in string aURI);
void updateSubscribedInSubscribeDS();
void subscribe(in string name);
void unsubscribe(in string name);
void subscribe(in wstring name);
void unsubscribe(in wstring name);
};

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

@ -1986,28 +1986,25 @@ nsImapIncomingServer::GetSubscribeListener(nsISubscribeListener **aListener)
}
NS_IMETHODIMP
nsImapIncomingServer::Subscribe(const char *aName)
nsImapIncomingServer::Subscribe(const PRUnichar *aName)
{
return SubscribeToFolder(aName, PR_TRUE);
}
NS_IMETHODIMP
nsImapIncomingServer::Unsubscribe(const char *aName)
nsImapIncomingServer::Unsubscribe(const PRUnichar *aName)
{
return SubscribeToFolder(aName, PR_FALSE);
}
nsresult
nsImapIncomingServer::SubscribeToFolder(const char *aName, PRBool subscribe)
nsImapIncomingServer::SubscribeToFolder(const PRUnichar *aName, PRBool subscribe)
{
nsresult rv;
nsCOMPtr<nsIImapService> imapService = do_GetService(kImapServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
if (!imapService) return NS_ERROR_FAILURE;
nsAutoString folderName;
folderName.AssignWithConversion(aName);
nsCOMPtr<nsIFolder> rootFolder;
rv = GetRootFolder(getter_AddRefs(rootFolder));
if (NS_FAILED(rv)) return rv;
@ -2024,21 +2021,15 @@ nsImapIncomingServer::SubscribeToFolder(const char *aName, PRBool subscribe)
if (NS_FAILED(rv)) return rv;
if (subscribe) {
#ifdef DEBUG_sspitzer
printf("subscribe to folder: %s\n",aName);
#endif
rv = imapService->SubscribeFolder(queue,
rootMsgFolder,
folderName.GetUnicode(),
aName,
nsnull, nsnull);
}
else {
#ifdef DEBUG_sspitzer
printf("unsubscribe to folder: %s\n",aName);
#endif
rv = imapService->UnsubscribeFolder(queue,
rootMsgFolder,
folderName.GetUnicode(),
aName,
nsnull, nsnull);
}

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

@ -71,7 +71,7 @@ protected:
PRBool AllDescendentsAreNoSelect(nsIFolder *parentFolder);
private:
nsresult SubscribeToFolder(const char *aName, PRBool subscribe);
nsresult SubscribeToFolder(const PRUnichar *aName, PRBool subscribe);
nsresult CreateImapConnection (nsIEventQueue* aEventQueue,
nsIImapUrl* aImapUrl,
nsIImapProtocol** aImapConnection);

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

@ -980,21 +980,19 @@ nsNntpIncomingServer::GetSubscribeListener(nsISubscribeListener **aListener)
}
NS_IMETHODIMP
nsNntpIncomingServer::Subscribe(const char *aName)
nsNntpIncomingServer::Subscribe(const PRUnichar *aUnicharName)
{
#ifdef DEBUG_NEWS
printf("subscribe to news group: %s\n",aName);
#endif
return SubscribeToNewsgroup(aName);
nsCAutoString name;
name.AssignWithConversion(aUnicharName);
return SubscribeToNewsgroup((const char *)name);
}
NS_IMETHODIMP
nsNntpIncomingServer::Unsubscribe(const char *aName)
nsNntpIncomingServer::Unsubscribe(const PRUnichar *aUnicharName)
{
nsresult rv;
#ifdef DEBUG_NEWS
printf("unsubscribe to news group: %s\n",aName);
#endif
nsCAutoString name;
name.AssignWithConversion(aUnicharName);
nsCOMPtr<nsIFolder> rootFolder;
rv = GetRootFolder(getter_AddRefs(rootFolder));
@ -1006,7 +1004,7 @@ nsNntpIncomingServer::Unsubscribe(const char *aName)
if (!serverFolder) return NS_ERROR_FAILURE;
nsCOMPtr <nsIFolder> subFolder;
rv = serverFolder->FindSubFolder(aName, getter_AddRefs(subFolder));
rv = serverFolder->FindSubFolder(name, getter_AddRefs(subFolder));
if (NS_FAILED(rv)) return rv;
nsCOMPtr <nsIMsgFolder> newsgroupFolder = do_QueryInterface(subFolder, &rv);