зеркало из https://github.com/mozilla/pjs.git
fix problem detecting if special folders, like the sent folder, exist r=racham, sr=sspitzer 78791
This commit is contained in:
Родитель
4c71ce01cc
Коммит
c153462eef
|
@ -28,26 +28,26 @@ interface nsIMsgMailNewsUrl;
|
|||
|
||||
[scriptable, uuid(8ec49a08-5cb0-11d3-a52c-0060b0fc04b7)]
|
||||
interface nsIImapServerSink : nsISupports {
|
||||
void PossibleImapMailbox(in string folderPath, in wchar hierarchyDelim, in long boxFlags);
|
||||
void DiscoveryDone();
|
||||
void OnlineFolderDelete(in string aFolderName);
|
||||
void OnlineFolderCreateFailed(in string aFolderName);
|
||||
void OnlineFolderRename(in string oldName, in string newName);
|
||||
void FolderIsNoSelect(in string aFolderName, out boolean aResult);
|
||||
void SetFolderAdminURL(in string aFolderName, in string adminUrl);
|
||||
void possibleImapMailbox(in string folderPath, in wchar hierarchyDelim, in long boxFlags);
|
||||
void discoveryDone();
|
||||
void onlineFolderDelete(in string aFolderName);
|
||||
void onlineFolderCreateFailed(in string aFolderName);
|
||||
void onlineFolderRename(in string oldName, in string newName);
|
||||
void folderIsNoSelect(in string aFolderName, out boolean aResult);
|
||||
void setFolderAdminURL(in string aFolderName, in string adminUrl);
|
||||
boolean folderVerifiedOnline(in string aFolderName);
|
||||
void subscribeUpgradeFinished(in boolean bringUpSubscribeUI);
|
||||
|
||||
void SubscribeUpgradeFinished(in boolean bringUpSubscribeUI);
|
||||
void setCapability(in unsigned long capability);
|
||||
void loadNextQueuedUrl(out boolean urlRun);
|
||||
|
||||
void SetCapability(in unsigned long capability);
|
||||
void LoadNextQueuedUrl(out boolean urlRun);
|
||||
|
||||
void GetImapStringByID(in long aMsgId, out wstring aString);
|
||||
void FEAlert(in wstring aString, in nsIMsgWindow aMsgWindow);
|
||||
void FEAlertFromServer(in string aString, in nsIMsgWindow aMsgWindow);
|
||||
void CommitNamespaces();
|
||||
void PromptForPassword(out string aString, in nsIMsgWindow aMsgWindow);
|
||||
void SetUserAuthenticated(in boolean authenticated);
|
||||
void SetMailServerUrls(in string manageMailAccount, in string manageLists, in string manageFilters);
|
||||
void getImapStringByID(in long aMsgId, out wstring aString);
|
||||
void fEAlert(in wstring aString, in nsIMsgWindow aMsgWindow);
|
||||
void fEAlertFromServer(in string aString, in nsIMsgWindow aMsgWindow);
|
||||
void commitNamespaces();
|
||||
void promptForPassword(out string aString, in nsIMsgWindow aMsgWindow);
|
||||
void setUserAuthenticated(in boolean authenticated);
|
||||
void setMailServerUrls(in string manageMailAccount, in string manageLists, in string manageFilters);
|
||||
|
||||
/* this is a bogus method on this interface but i need it until misc. sink is scriptable.. */
|
||||
void RemoveChannelFromUrl(in nsIMsgMailNewsUrl aUrl, in unsigned long statusCode);
|
||||
|
|
|
@ -1284,6 +1284,26 @@ NS_IMETHODIMP nsImapIncomingServer::SubscribeUpgradeFinished(PRBool bringUpSubs
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::FolderVerifiedOnline(const char *folderName, PRBool *aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = PR_FALSE;
|
||||
nsCOMPtr<nsIFolder> rootFolder;
|
||||
nsresult rv = GetRootFolder(getter_AddRefs(rootFolder));
|
||||
if (NS_SUCCEEDED(rv) && rootFolder)
|
||||
{
|
||||
nsCOMPtr<nsIFolder> aFolder;
|
||||
rv = rootFolder->FindSubFolder(folderName, getter_AddRefs(aFolder));
|
||||
if (NS_SUCCEEDED(rv) && aFolder)
|
||||
{
|
||||
nsCOMPtr<nsIImapMailFolderSink> imapFolder = do_QueryInterface(aFolder);
|
||||
if (imapFolder)
|
||||
imapFolder->GetFolderVerifiedOnline(aResult);
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsImapIncomingServer::DiscoveryDone()
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
|
|
@ -4898,8 +4898,27 @@ void nsImapProtocol::OnEnsureExistsFolder(const char * aSourceMailbox)
|
|||
|
||||
List(aSourceMailbox, PR_FALSE); // how to tell if that succeeded?
|
||||
PRBool exists = PR_FALSE;
|
||||
if (m_imapMailFolderSink)
|
||||
m_imapMailFolderSink->GetFolderVerifiedOnline(&exists);
|
||||
|
||||
// try converting aSourceMailbox to canonical format
|
||||
|
||||
nsIMAPNamespace *nsForMailbox = nsnull;
|
||||
m_hostSessionList->GetNamespaceForMailboxForHost(GetImapServerKey(),
|
||||
aSourceMailbox, nsForMailbox);
|
||||
// NS_ASSERTION (nsForMailbox, "Oops .. null nsForMailbox\n");
|
||||
|
||||
nsXPIDLCString name;
|
||||
|
||||
if (nsForMailbox)
|
||||
m_runningUrl->AllocateCanonicalPath(aSourceMailbox,
|
||||
nsForMailbox->GetDelimiter(),
|
||||
getter_Copies(name));
|
||||
else
|
||||
m_runningUrl->AllocateCanonicalPath(aSourceMailbox,
|
||||
kOnlineHierarchySeparatorUnknown,
|
||||
getter_Copies(name));
|
||||
|
||||
if (m_imapServerSink)
|
||||
m_imapServerSink->FolderVerifiedOnline(name, &exists);
|
||||
|
||||
if (exists)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче