fix 209545 get rid of remaining hand-rolled proxying code, use xpidl instead, sr=mscott

This commit is contained in:
bienvenu%nventure.com 2005-01-12 15:20:32 +00:00
Родитель d808e4118d
Коммит 0ce740e95e
16 изменённых файлов: 87 добавлений и 978 удалений

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

@ -78,28 +78,15 @@ interface nsIImapMailFolderSink : nsISupports {
attribute boolean folderQuotaCommandIssued;
/**
* Indicates whether the server has provided quota information on this folder.
* This attribute can be false if the server does not supports quotas, if the folder
* has never been opened, or if there are no storage quotas on this folder.
* If it is true, the folder has a storage quota and the folderQuotaUsedKB and
* folderQuotaMaxKB attributes are set to the values provided by the server.
*/
attribute boolean folderQuotaDataIsValid;
* Set FolderQuotaData information
* @param aFolderQuotaRoot The IMAP quota root for this folder,
* as returned by the GETQUOTAROOT IMAP command.
* @param aFolderQuotaUsedKB Used space, in KB, on this folder's quota root.
* @param aFolderQuotaMaxKB Size, in KB, of this folder's quota root.
**/
void setFolderQuotaData(in ACString aFolderQuotaRoot, in unsigned long aFolderQuotaUsedKB,
in unsigned long aFolderQuotaMaxKB);
/**
* The IMAP quota root for this folder, as returned by the GETQUOTAROOT IMAP command.
*/
attribute ACString folderQuotaRoot;
/**
* Used space, in kilobytes, on this folder's quota root.
*/
attribute unsigned long folderQuotaUsedKB;
/**
* Size, in kilobytes, of this folder's quota root.
*/
attribute unsigned long folderQuotaMaxKB;
readonly attribute boolean shouldDownloadAllHeaders;
string GetOnlineDelimiter();
void OnNewIdleMessages();
@ -126,4 +113,17 @@ interface nsIImapMailFolderSink : nsISupports {
void closeMockChannel(in nsIImapMockChannel aChannel);
void setUrlState(in nsIImapProtocol aProtocol, in nsIMsgMailNewsUrl aUrl, in boolean isRunning, in nsresult status);
void releaseUrlCacheEntry(in nsIMsgMailNewsUrl aUrl);
void headerFetchCompleted(in nsIImapProtocol aProtocol);
void setBiffStateAndUpdate(in long biffState);
void progressStatus(in nsIImapProtocol aProtocol, in unsigned long aMsgId, in wstring extraInfo);
void percentProgress(in nsIImapProtocol aProtocol, in wstring aMessage,
in long aCurrentProgress, in long aMaxProgressProgressInfo);
void clearFolderRights();
void setCopyResponseUid(in string msgIdString,
in nsIImapUrl aUrl);
void setAppendMsgUid(in nsMsgKey newKey,
in nsIImapUrl aUrl);
ACString getMessageId(in nsIImapUrl aUrl);
};

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

@ -39,8 +39,6 @@
interface nsIImapMailFolderSink;
interface nsIImapMessageSink;
interface nsIImapExtensionSink;
interface nsIImapMiscellaneousSink;
interface nsIImapServerSink;
interface nsIImapMockChannel;
interface nsIFileSpec;
@ -74,8 +72,6 @@ interface nsIImapUrl : nsISupports
///////////////////////////////////////////////////////////////////////////////
attribute nsIImapMailFolderSink imapMailFolderSink;
attribute nsIImapMessageSink imapMessageSink;
[noscript] attribute nsIImapExtensionSink imapExtensionSink;
[noscript] attribute nsIImapMiscellaneousSink imapMiscellaneousSink;
attribute nsIImapServerSink imapServerSink;
///////////////////////////////////////////////////////////////////////////////
// Getters and Setters for the imap url state

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

@ -101,7 +101,6 @@ CPPSRCS = \
nsImapIncomingServer.cpp \
nsImapMailFolder.cpp \
nsImapProtocol.cpp \
nsImapProxyEvent.cpp \
nsImapSearchResults.cpp \
nsImapServerResponseParser.cpp \
nsImapService.cpp \

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

@ -109,6 +109,7 @@
#include "nsISpamSettings.h"
#include "nsInt64.h"
#include <time.h>
#include "nsIMsgMailNewsUrl.h"
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
static NS_DEFINE_CID(kCMailDB, NS_MAILDB_CID);
@ -258,8 +259,6 @@ NS_IMPL_QUERY_HEAD(nsImapMailFolder)
NS_IMPL_QUERY_BODY(nsICopyMessageListener)
NS_IMPL_QUERY_BODY(nsIImapMailFolderSink)
NS_IMPL_QUERY_BODY(nsIImapMessageSink)
NS_IMPL_QUERY_BODY(nsIImapExtensionSink)
NS_IMPL_QUERY_BODY(nsIImapMiscellaneousSink)
NS_IMPL_QUERY_BODY(nsIUrlListener)
NS_IMPL_QUERY_BODY(nsIMsgFilterHitNotify)
NS_IMPL_QUERY_BODY(nsIJunkMailClassificationListener)
@ -4846,8 +4845,7 @@ void nsImapMailFolder::UpdatePendingCounts()
// nsIImapExtensionSink methods
NS_IMETHODIMP
nsImapMailFolder::ClearFolderRights(nsIImapProtocol* aProtocol,
nsIMAPACLRightsInfo* aclRights)
nsImapMailFolder::ClearFolderRights()
{
SetFolderNeedsACLListed(PR_FALSE);
delete m_folderACL;
@ -4874,9 +4872,7 @@ nsImapMailFolder::RefreshFolderRights()
}
NS_IMETHODIMP
nsImapMailFolder::SetCopyResponseUid(nsIImapProtocol* aProtocol,
nsMsgKeyArray* aKeyArray,
const char* msgIdString,
nsImapMailFolder::SetCopyResponseUid(const char* msgIdString,
nsIImapUrl * aUrl)
{ // CopyMessages() only
nsresult rv = NS_OK;
@ -4895,7 +4891,7 @@ nsImapMailFolder::SetCopyResponseUid(nsIImapProtocol* aProtocol,
msgTxn = do_QueryInterface(mailCopyState->m_undoMsgTxn, &rv);
}
if (msgTxn)
msgTxn->SetCopyResponseUid(aKeyArray, msgIdString);
msgTxn->SetCopyResponseUid(msgIdString);
return NS_OK;
}
@ -4996,8 +4992,7 @@ nsImapMailFolder::NotifySearchHit(nsIMsgMailNewsUrl * aUrl,
NS_IMETHODIMP
nsImapMailFolder::SetAppendMsgUid(nsIImapProtocol* aProtocol,
nsMsgKey aKey,
nsImapMailFolder::SetAppendMsgUid(nsMsgKey aKey,
nsIImapUrl * aUrl)
{
nsresult rv = NS_OK;
@ -5025,9 +5020,8 @@ nsImapMailFolder::SetAppendMsgUid(nsIImapProtocol* aProtocol,
}
NS_IMETHODIMP
nsImapMailFolder::GetMessageId(nsIImapProtocol* aProtocl,
nsCString* messageId,
nsIImapUrl * aUrl)
nsImapMailFolder::GetMessageId(nsIImapUrl * aUrl,
nsACString &messageId)
{
nsresult rv = NS_OK;
nsCOMPtr<nsISupports> copyState;
@ -5040,18 +5034,22 @@ nsImapMailFolder::GetMessageId(nsIImapProtocol* aProtocl,
do_QueryInterface(copyState, &rv);
if (NS_FAILED(rv)) return rv;
if (mailCopyState->m_listener)
rv = mailCopyState->m_listener->GetMessageId(messageId);
{
nsCAutoString tempMessageId;
rv = mailCopyState->m_listener->GetMessageId(&tempMessageId);
messageId.Assign(tempMessageId);
}
}
if (NS_SUCCEEDED(rv) && messageId->Length() > 0)
if (NS_SUCCEEDED(rv) && messageId.Length() > 0)
{
if (messageId->First() == '<')
messageId->Cut(0, 1);
if (messageId->Last() == '>')
messageId->SetLength(messageId->Length() -1);
if (messageId.First() == '<')
messageId.Cut(0, 1);
if (messageId.Last() == '>')
messageId.SetLength(messageId.Length() -1);
}
return rv;
}
// nsIImapMiscellaneousSink methods
NS_IMETHODIMP
nsImapMailFolder::AddSearchResult(nsIImapProtocol* aProtocol,
const char* searchHitLine)
@ -5142,8 +5140,7 @@ nsImapMailFolder::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
}
NS_IMETHODIMP
nsImapMailFolder::SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState)
nsImapMailFolder::SetBiffStateAndUpdate(nsMsgBiffState biffState)
{
SetBiffState(biffState);
return NS_OK;
@ -5908,7 +5905,8 @@ nsImapMailFolder::ProgressStatus(nsIImapProtocol* aProtocol,
NS_IMETHODIMP
nsImapMailFolder::PercentProgress(nsIImapProtocol* aProtocol,
ProgressInfo* aInfo)
const PRUnichar *aMessage,
PRInt32 aCurrentProgress, PRInt32 aMaxProgress)
{
if (aProtocol)
{
@ -5929,11 +5927,10 @@ nsImapMailFolder::PercentProgress(nsIImapProtocol* aProtocol,
// XXX handle 64-bit ints for real
progressSink->OnProgress(request, nsnull,
nsUint64(aInfo->currentProgress),
nsUint64(aInfo->maxProgress));
if (aInfo->message)
progressSink->OnStatus(request, nsnull, NS_OK, aInfo->message); // XXX i18n message
nsUint64(aCurrentProgress),
nsUint64(aMaxProgress));
if (aMessage)
progressSink->OnStatus(request, nsnull, NS_OK, aMessage); // XXX i18n message
}
}
@ -7258,55 +7255,15 @@ NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaCommandIssued(PRBool aCmdIssued)
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::GetFolderQuotaDataIsValid(PRBool *aIsValid)
NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaData(const nsACString &aFolderQuotaRoot,
PRUint32 aFolderQuotaUsedKB,
PRUint32 aFolderQuotaMaxKB)
{
NS_ENSURE_ARG_POINTER(aIsValid);
*aIsValid = m_folderQuotaDataIsValid;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaDataIsValid(PRBool aIsValid)
{
m_folderQuotaDataIsValid = aIsValid;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::GetFolderQuotaRoot(nsACString &aQuotaRoot)
{
aQuotaRoot = m_folderQuotaRoot;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaRoot(const nsACString &aQuotaRoot)
{
m_folderQuotaRoot = aQuotaRoot;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::GetFolderQuotaUsedKB(PRUint32 *aUsedKB)
{
NS_ENSURE_ARG_POINTER(aUsedKB);
*aUsedKB = m_folderQuotaUsedKB;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaUsedKB(PRUint32 aUsedKB)
{
m_folderQuotaUsedKB = aUsedKB;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::GetFolderQuotaMaxKB(PRUint32 *aMaxKB)
{
NS_ENSURE_ARG_POINTER(aMaxKB);
*aMaxKB = m_folderQuotaMaxKB;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::SetFolderQuotaMaxKB(PRUint32 aMaxKB)
{
m_folderQuotaMaxKB = aMaxKB;
return NS_OK;
m_folderQuotaDataIsValid = PR_TRUE;
m_folderQuotaRoot = aFolderQuotaRoot;
m_folderQuotaUsedKB = aFolderQuotaUsedKB;
m_folderQuotaMaxKB = aFolderQuotaMaxKB;
return NS_OK;
}
NS_IMETHODIMP nsImapMailFolder::PerformExpand(nsIMsgWindow *aMsgWindow)

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

@ -42,8 +42,6 @@
#include "nsMsgDBFolder.h"
#include "nsIImapMailFolderSink.h"
#include "nsIImapMessageSink.h"
#include "nsIImapExtensionSink.h"
#include "nsIImapMiscellaneousSink.h"
#include "nsICopyMessageListener.h"
#include "nsIImapService.h"
#include "nsIUrlListener.h"
@ -193,8 +191,6 @@ class nsImapMailFolder : public nsMsgDBFolder,
public nsIMsgImapMailFolder,
public nsIImapMailFolderSink,
public nsIImapMessageSink,
public nsIImapExtensionSink,
public nsIImapMiscellaneousSink,
public nsICopyMessageListener,
public nsIMsgFilterHitNotify,
public nsIJunkMailClassificationListener
@ -300,32 +296,9 @@ public:
NS_IMETHOD OnStartRunningUrl(nsIURI * aUrl);
NS_IMETHOD OnStopRunningUrl(nsIURI * aUrl, nsresult aExitCode);
// nsIImapExtensionSink methods
NS_IMETHOD ClearFolderRights(nsIImapProtocol* aProtocol,
nsIMAPACLRightsInfo* aclRights);
NS_IMETHOD SetCopyResponseUid(nsIImapProtocol* aProtocol,
nsMsgKeyArray* keyArray,
const char* msgIdString,
nsIImapUrl * aUrl);
NS_IMETHOD SetAppendMsgUid(nsIImapProtocol* aProtocol,
nsMsgKey aKey,
nsIImapUrl * aUrl);
NS_IMETHOD GetMessageId(nsIImapProtocol* aProtocol,
nsCString* messageId,
nsIImapUrl * aUrl);
// nsIImapMiscellaneousSink methods
NS_IMETHOD AddSearchResult(nsIImapProtocol* aProtocol,
const char* searchHitLine);
NS_IMETHOD HeaderFetchCompleted(nsIImapProtocol* aProtocol);
// ****
NS_IMETHOD SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState);
NS_IMETHOD ProgressStatus(nsIImapProtocol* aProtocol,
PRUint32 aMsgId, const PRUnichar *extraInfo);
NS_IMETHOD PercentProgress(nsIImapProtocol* aProtocol,
ProgressInfo* aInfo);
NS_IMETHOD MatchName(nsString *name, PRBool *matches);
NS_DECL_NSIMSGFILTERHITNOTIFY

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

@ -59,7 +59,6 @@
#include "nsImapProtocol.h"
#include "nsIMsgMailNewsUrl.h"
#include "nscore.h"
#include "nsImapProxyEvent.h"
#include "nsIMAPHostSessionList.h"
#include "nsIMAPBodyShell.h"
#include "nsImapMailFolder.h"
@ -617,7 +616,6 @@ void
nsImapProtocol::SetupSinkProxy()
{
nsresult res = NS_ERROR_FAILURE;
// NS_ASSERTION(!m_imapMiscellaneousSink, "shouldn't be non-null here");
if (m_runningUrl)
{
@ -649,33 +647,6 @@ nsImapProtocol::SetupSinkProxy()
PROXY_SYNC | PROXY_ALWAYS,
getter_AddRefs(m_imapMessageSink));
}
if (!m_imapExtensionSink)
{
nsCOMPtr<nsIImapExtensionSink> aImapExtensionSink;
res = m_runningUrl->GetImapExtensionSink(getter_AddRefs(aImapExtensionSink));
if(NS_SUCCEEDED(res) && aImapExtensionSink)
{
nsImapExtensionSinkProxy * extensionSink = new nsImapExtensionSinkProxy(aImapExtensionSink,
this,
m_sinkEventQueue,
m_thread);
m_imapExtensionSink = do_QueryInterface(extensionSink);
}
}
if (!m_imapMiscellaneousSink)
{
nsCOMPtr<nsIImapMiscellaneousSink> aImapMiscellaneousSink;
res = m_runningUrl->GetImapMiscellaneousSink(getter_AddRefs(aImapMiscellaneousSink));
if (NS_SUCCEEDED(res) && aImapMiscellaneousSink)
{
nsImapMiscellaneousSinkProxy * miscSink = new nsImapMiscellaneousSinkProxy(aImapMiscellaneousSink,
this,
m_sinkEventQueue,
m_thread);
m_imapMiscellaneousSink = do_QueryInterface(miscSink);
}
NS_ASSERTION(NS_SUCCEEDED(res), "couldn't get proxies");
}
if (!m_imapServerSink)
{
nsCOMPtr<nsIImapServerSink> aImapServerSink;
@ -890,8 +861,6 @@ void nsImapProtocol::ReleaseUrlState(PRBool rerunning)
}
m_channelContext = nsnull; // this might be the url - null it out before the final release of the url
m_imapMessageSink = nsnull;
m_imapExtensionSink = nsnull;
m_imapMiscellaneousSink = nsnull;
m_channelListener = nsnull;
m_channelInputStream = nsnull;
@ -993,9 +962,7 @@ NS_IMETHODIMP nsImapProtocol::Run()
me->m_sinkEventQueue = nsnull;
me->m_server = nsnull;
me->m_imapMailFolderSink = nsnull;
me->m_imapExtensionSink = nsnull;
me->m_imapMessageSink = nsnull;
me->m_imapMiscellaneousSink = nsnull;
m_iThread = nsnull;
return NS_OK;
@ -1328,10 +1295,7 @@ PRBool nsImapProtocol::ProcessCurrentURL()
}
}
#ifdef DEBUG_bienvenu
NS_ASSERTION(m_imapMiscellaneousSink, "null sink");
#endif
if (!m_imapMiscellaneousSink || !m_imapMailFolderSink)
if (!m_imapMailFolderSink)
SetupSinkProxy(); // try this again. Evil, but I'm desperate.
// Reinitialize the parser
@ -3724,11 +3688,8 @@ void nsImapProtocol::HeaderFetchCompleted()
m_imapMailFolderSink->ParseMsgHdrs(this, &m_hdrDownloadCache);
m_hdrDownloadCache.ReleaseAll();
if (m_imapMiscellaneousSink)
{
m_imapMiscellaneousSink->HeaderFetchCompleted(this);
WaitForFEEventCompletion();
}
if (m_imapMailFolderSink)
m_imapMailFolderSink->HeaderFetchCompleted(this);
}
@ -3781,10 +3742,8 @@ void nsImapProtocol::PeriodicBiff()
void nsImapProtocol::SendSetBiffIndicatorEvent(nsMsgBiffState newState)
{
if (m_imapMiscellaneousSink) {
m_imapMiscellaneousSink->SetBiffStateAndUpdate(this, newState);
WaitForFEEventCompletion();
}
if (m_imapMailFolderSink)
m_imapMailFolderSink->SetBiffStateAndUpdate(newState);
}
@ -4160,15 +4119,10 @@ void nsImapProtocol::AddFolderRightsForUser(const char *mailboxName, const char
HandleMemoryFailure();
}
void nsImapProtocol::SetCopyResponseUid(nsMsgKeyArray* aKeyArray,
const char *msgIdString)
void nsImapProtocol::SetCopyResponseUid(const char *msgIdString)
{
if (m_imapExtensionSink)
{
m_imapExtensionSink->SetCopyResponseUid(this,aKeyArray, msgIdString,
m_runningUrl);
WaitForFEEventCompletion();
}
if (m_imapMailFolderSink)
m_imapMailFolderSink->SetCopyResponseUid(msgIdString, m_runningUrl);
}
void nsImapProtocol::CommitNamespacesForHostEvent()
@ -4211,14 +4165,9 @@ void nsImapProtocol::ClearAllFolderRights(const char *mailboxName,
aclRightsInfo->rights = NULL;
aclRightsInfo->userName = NULL;
if (aclRightsInfo->hostName && aclRightsInfo->mailboxName)
{
if (m_imapExtensionSink)
{
m_imapExtensionSink->ClearFolderRights(this, aclRightsInfo);
WaitForFEEventCompletion();
}
}
if (aclRightsInfo->hostName && aclRightsInfo->mailboxName && m_imapMailFolderSink)
m_imapMailFolderSink->ClearFolderRights();
PR_Free(aclRightsInfo->hostName);
PR_Free(aclRightsInfo->mailboxName);
@ -4607,9 +4556,9 @@ nsImapProtocol::ShowProgress()
void
nsImapProtocol::ProgressEventFunctionUsingId(PRUint32 aMsgId)
{
if (m_imapMiscellaneousSink && aMsgId != m_lastProgressStringId)
if (m_imapMailFolderSink && aMsgId != m_lastProgressStringId)
{
m_imapMiscellaneousSink->ProgressStatus(this, aMsgId, nsnull);
m_imapMailFolderSink->ProgressStatus(this, aMsgId, nsnull);
m_lastProgressStringId = aMsgId;
// who's going to free this? Does ProgressStatus complete synchronously?
}
@ -4619,12 +4568,12 @@ void
nsImapProtocol::ProgressEventFunctionUsingIdWithString(PRUint32 aMsgId, const
char * aExtraInfo)
{
if (m_imapMiscellaneousSink)
if (m_imapMailFolderSink)
{
nsXPIDLString unicodeStr;
nsresult rv = CopyMUTF7toUTF16(nsDependentCString(aExtraInfo), unicodeStr);
if (NS_SUCCEEDED(rv))
m_imapMiscellaneousSink->ProgressStatus(this, aMsgId, unicodeStr);
m_imapMailFolderSink->ProgressStatus(this, aMsgId, unicodeStr);
}
}
@ -4650,10 +4599,6 @@ nsImapProtocol::PercentProgressUpdateEvent(PRUnichar *message, PRInt32 currentPr
return;
}
ProgressInfo aProgressInfo;
aProgressInfo.message = message;
aProgressInfo.currentProgress = currentProgress;
aProgressInfo.maxProgress = maxProgress;
m_lastPercent = percent;
m_lastProgressTime = nowMS;
@ -4662,8 +4607,8 @@ nsImapProtocol::PercentProgressUpdateEvent(PRUnichar *message, PRInt32 currentPr
m_mockChannel->SetContentLength(maxProgress);
if (m_imapMiscellaneousSink)
m_imapMiscellaneousSink->PercentProgress(this, &aProgressInfo);
if (m_imapMailFolderSink)
m_imapMailFolderSink->PercentProgress(this, message, currentProgress, maxProgress);
}
// imap commands issued by the parser
@ -5262,10 +5207,9 @@ void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec,
kUidplusCapability)
{
nsMsgKey newKey = GetServerStateParser().CurrentResponseUID();
if (m_imapExtensionSink)
if (m_imapMailFolderSink)
{
m_imapExtensionSink->SetAppendMsgUid(this, newKey,
m_runningUrl);
m_imapMailFolderSink->SetAppendMsgUid(newKey, m_runningUrl);
WaitForFEEventCompletion();
}
nsXPIDLCString oldMsgId;
@ -5284,14 +5228,12 @@ void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec,
// as when copying messages to an imap folder from local folders or an other imap server.
// This made sending a message slow when there was a large sent folder. I don't believe
// this code worked anyway.
else if (m_imapExtensionSink && imapAction == nsIImapUrl::nsImapAppendDraftFromFile )
else if (m_imapMailFolderSink && imapAction == nsIImapUrl::nsImapAppendDraftFromFile )
{ // *** code me to search for the newly appended message
// go to selected state
AutoSubscribeToMailboxIfNecessary(mailboxName);
nsCString messageId;
rv = m_imapExtensionSink->GetMessageId(this, &messageId,
m_runningUrl);
WaitForFEEventCompletion();
rv = m_imapMailFolderSink->GetMessageId(m_runningUrl, messageId);
if (NS_SUCCEEDED(rv) && !messageId.IsEmpty() &&
GetServerStateParser().LastCommandSuccessful())
{
@ -5317,11 +5259,7 @@ void nsImapProtocol::UploadMessageFromFile (nsIFileSpec* fileSpec,
newkey = searchResult->GetNextMessageNumber();
delete searchResult;
if (newkey != nsMsgKey_None)
{
m_imapExtensionSink->SetAppendMsgUid
(this, newkey, m_runningUrl);
WaitForFEEventCompletion();
}
m_imapMailFolderSink->SetAppendMsgUid(newkey, m_runningUrl);
}
}
}
@ -7517,10 +7455,7 @@ void nsImapProtocol::UpdateFolderQuotaData(nsCString& aQuotaRoot, PRUint32 aUsed
{
NS_ASSERTION(m_imapMailFolderSink, "m_imapMailFolderSink is null!");
m_imapMailFolderSink->SetFolderQuotaDataIsValid(PR_TRUE);
m_imapMailFolderSink->SetFolderQuotaRoot(aQuotaRoot);
m_imapMailFolderSink->SetFolderQuotaUsedKB(aUsed);
m_imapMailFolderSink->SetFolderQuotaMaxKB(aMax);
m_imapMailFolderSink->SetFolderQuotaData(aQuotaRoot, aUsed, aMax);
}
void nsImapProtocol::GetQuotaDataIfSupported(const char *aBoxName)

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

@ -356,8 +356,7 @@ public:
void HandleCurrentUrlError();
// UIDPLUS extension
void SetCopyResponseUid(nsMsgKeyArray* aKeyArray,
const char* msgIdString);
void SetCopyResponseUid(const char* msgIdString);
// Quota support
void UpdateFolderQuotaData(nsCString& aQuotaRoot, PRUint32 aUsed, PRUint32 aMax);
@ -597,7 +596,7 @@ private:
nsCOMPtr <nsIImapHeaderInfo> m_curHdrInfo;
nsIImapHostSessionList * m_hostSessionList;
PRBool m_fromHeaderSeen;
// these settings allow clients to override various pieces of the connection info from the url

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

@ -119,511 +119,3 @@ nsImapProxyBase::~nsImapProxyBase()
NS_IF_RELEASE(m_eventQueue);
}
nsImapExtensionSinkProxy::nsImapExtensionSinkProxy(nsIImapExtensionSink* aImapExtensionSink,
nsIImapProtocol* aProtocol,
nsIEventQueue* aEventQ,
PRThread* aThread) :
nsImapProxyBase(aProtocol, aEventQ, aThread)
{
NS_ASSERTION (aImapExtensionSink,
"nsImapExtensionSinkProxy: invalid aImapExtensionSink");
m_realImapExtensionSink = aImapExtensionSink;
NS_IF_ADDREF (m_realImapExtensionSink);
}
nsImapExtensionSinkProxy::~nsImapExtensionSinkProxy()
{
NS_IF_RELEASE (m_realImapExtensionSink);
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsImapExtensionSinkProxy, nsIImapExtensionSink)
NS_IMETHODIMP
nsImapExtensionSinkProxy::ClearFolderRights(nsIImapProtocol* aProtocol,
nsIMAPACLRightsInfo* aclRights)
{
nsresult res = NS_OK;
NS_PRECONDITION (aclRights, "Oops... null aclRights");
if(!aclRights)
return NS_ERROR_NULL_POINTER;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
ClearFolderRightsProxyEvent *ev =
new ClearFolderRightsProxyEvent(this, aclRights);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapExtensionSink->ClearFolderRights(aProtocol, aclRights);
aProtocol->NotifyFEEventCompletion();
}
return res;
}
NS_IMETHODIMP
nsImapExtensionSinkProxy::SetCopyResponseUid(nsIImapProtocol* aProtocol,
nsMsgKeyArray* aKeyArray,
const char* msgIdString,
nsIImapUrl * aUrl)
{
nsresult res = NS_OK;
NS_PRECONDITION (aKeyArray, "Oops... null aKeyArray");
if(!aKeyArray)
return NS_ERROR_NULL_POINTER;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
SetCopyResponseUidProxyEvent *ev =
new SetCopyResponseUidProxyEvent(this, aKeyArray, msgIdString,
aUrl);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapExtensionSink->SetCopyResponseUid(aProtocol,
aKeyArray,
msgIdString,
aUrl);
}
return res;
}
NS_IMETHODIMP
nsImapExtensionSinkProxy::SetAppendMsgUid(nsIImapProtocol* aProtocol,
nsMsgKey aKey,
nsIImapUrl * aUrl)
{
nsresult res = NS_OK;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
SetAppendMsgUidProxyEvent *ev =
new SetAppendMsgUidProxyEvent(this, aKey, aUrl);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapExtensionSink->SetAppendMsgUid(aProtocol,
aKey,
aUrl);
}
return res;
}
NS_IMETHODIMP
nsImapExtensionSinkProxy::GetMessageId(nsIImapProtocol* aProtocol,
nsCString* messageId,
nsIImapUrl * aUrl)
{
nsresult res = NS_OK;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
GetMessageIdProxyEvent *ev =
new GetMessageIdProxyEvent(this, messageId, aUrl);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapExtensionSink->GetMessageId(aProtocol,
messageId,
aUrl);
}
return res;
}
nsImapMiscellaneousSinkProxy::nsImapMiscellaneousSinkProxy(
nsIImapMiscellaneousSink* aImapMiscellaneousSink,
nsIImapProtocol* aProtocol,
nsIEventQueue* aEventQ,
PRThread* aThread) : nsImapProxyBase(aProtocol, aEventQ, aThread)
{
NS_ASSERTION (aImapMiscellaneousSink,
"nsImapMiscellaneousSinkProxy: invalid aImapMiscellaneousSink");
m_realImapMiscellaneousSink = aImapMiscellaneousSink;
NS_IF_ADDREF (m_realImapMiscellaneousSink);
}
nsImapMiscellaneousSinkProxy::~nsImapMiscellaneousSinkProxy()
{
NS_IF_RELEASE (m_realImapMiscellaneousSink);
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsImapMiscellaneousSinkProxy, nsIImapMiscellaneousSink)
NS_IMETHODIMP
nsImapMiscellaneousSinkProxy::HeaderFetchCompleted(nsIImapProtocol* aProtocol)
{
nsresult res = NS_OK;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
HeaderFetchCompletedProxyEvent *ev =
new HeaderFetchCompletedProxyEvent(this);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapMiscellaneousSink->HeaderFetchCompleted(aProtocol);
aProtocol->NotifyFEEventCompletion();
}
return res;
}
NS_IMETHODIMP
nsImapMiscellaneousSinkProxy::SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState)
{
nsresult res = NS_OK;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
SetBiffStateAndUpdateProxyEvent *ev =
new SetBiffStateAndUpdateProxyEvent(this, biffState);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
{
ev->SetNotifyCompletion(PR_TRUE);
ev->PostEvent(m_eventQueue);
}
}
else
{
res = m_realImapMiscellaneousSink->SetBiffStateAndUpdate(aProtocol, biffState);
aProtocol->NotifyFEEventCompletion();
}
return res;
}
NS_IMETHODIMP
nsImapMiscellaneousSinkProxy::ProgressStatus(nsIImapProtocol* aProtocol,
PRUint32 aMsgId, const PRUnichar *extraInfo)
{
nsresult res = NS_OK;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
ProgressStatusProxyEvent *ev =
new ProgressStatusProxyEvent(this, aMsgId, extraInfo);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
ev->PostEvent(m_eventQueue);
}
else
{
res = m_realImapMiscellaneousSink->ProgressStatus(aProtocol, aMsgId, extraInfo);
}
return res;
}
NS_IMETHODIMP
nsImapMiscellaneousSinkProxy::PercentProgress(nsIImapProtocol* aProtocol,
ProgressInfo* aInfo)
{
nsresult res = NS_OK;
NS_PRECONDITION (aInfo, "Oops... null aInfo");
if(!aInfo)
return NS_ERROR_NULL_POINTER;
NS_ASSERTION (m_protocol == aProtocol, "Ooh ooh, wrong protocol");
if (PR_GetCurrentThread() == m_thread)
{
PercentProgressProxyEvent *ev =
new PercentProgressProxyEvent(this, aInfo);
if(nsnull == ev)
res = NS_ERROR_OUT_OF_MEMORY;
else
ev->PostEvent(m_eventQueue);
}
else
{
res = m_realImapMiscellaneousSink->PercentProgress(aProtocol, aInfo);
}
return res;
}
////
nsImapExtensionSinkProxyEvent::nsImapExtensionSinkProxyEvent(
nsImapExtensionSinkProxy* aProxy)
{
NS_ASSERTION (aProxy, "fatal a null imap extension proxy");
m_proxy = aProxy;
NS_IF_ADDREF (m_proxy);
}
nsImapExtensionSinkProxyEvent::~nsImapExtensionSinkProxyEvent()
{
NS_IF_RELEASE (m_proxy);
}
ClearFolderRightsProxyEvent::ClearFolderRightsProxyEvent(
nsImapExtensionSinkProxy* aProxy, nsIMAPACLRightsInfo* aclRights) :
nsImapExtensionSinkProxyEvent(aProxy)
{
NS_ASSERTION (aclRights, "Oops... a null acl rights info");
if (aclRights)
{
m_aclRightsInfo.hostName = PL_strdup(aclRights->hostName);
m_aclRightsInfo.mailboxName = PL_strdup(aclRights->mailboxName);
m_aclRightsInfo.userName = PL_strdup(aclRights->userName);
m_aclRightsInfo.rights = PL_strdup(aclRights->rights);
}
else
{
m_aclRightsInfo.hostName = nsnull;
m_aclRightsInfo.mailboxName = nsnull;
m_aclRightsInfo.userName = nsnull;
m_aclRightsInfo.rights = nsnull;
}
}
ClearFolderRightsProxyEvent::~ClearFolderRightsProxyEvent()
{
if (m_aclRightsInfo.hostName)
PL_strfree(m_aclRightsInfo.hostName);
if (m_aclRightsInfo.mailboxName)
PL_strfree(m_aclRightsInfo.mailboxName);
if (m_aclRightsInfo.userName)
PL_strfree(m_aclRightsInfo.userName);
if (m_aclRightsInfo.rights)
PL_strfree(m_aclRightsInfo.rights);
}
NS_IMETHODIMP
ClearFolderRightsProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapExtensionSink->ClearFolderRights(
m_proxy->m_protocol, &m_aclRightsInfo);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
SetCopyResponseUidProxyEvent::SetCopyResponseUidProxyEvent(
nsImapExtensionSinkProxy* aProxy, nsMsgKeyArray* aKeyArray,
const char* msgIdString, nsIImapUrl * aUrl) :
nsImapExtensionSinkProxyEvent(aProxy), m_msgIdString(msgIdString)
{
NS_ASSERTION (aKeyArray, "Oops... a null key array");
if (aKeyArray)
{
m_copyKeyArray.CopyArray(aKeyArray);
}
m_Url = aUrl;
}
SetCopyResponseUidProxyEvent::~SetCopyResponseUidProxyEvent()
{
}
NS_IMETHODIMP
SetCopyResponseUidProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapExtensionSink->SetCopyResponseUid(
m_proxy->m_protocol, &m_copyKeyArray, m_msgIdString.get(),
m_Url);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
SetAppendMsgUidProxyEvent::SetAppendMsgUidProxyEvent(
nsImapExtensionSinkProxy* aProxy, nsMsgKey aKey, nsIImapUrl * aUrl) :
nsImapExtensionSinkProxyEvent(aProxy), m_key(aKey)
{
m_Url = aUrl;
}
SetAppendMsgUidProxyEvent::~SetAppendMsgUidProxyEvent()
{
}
NS_IMETHODIMP
SetAppendMsgUidProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapExtensionSink->SetAppendMsgUid(
m_proxy->m_protocol, m_key, m_Url);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
GetMessageIdProxyEvent::GetMessageIdProxyEvent(
nsImapExtensionSinkProxy* aProxy, nsCString* messageId,
nsIImapUrl * aUrl) :
nsImapExtensionSinkProxyEvent(aProxy), m_messageId(messageId)
{
m_Url = aUrl;
}
GetMessageIdProxyEvent::~GetMessageIdProxyEvent()
{
}
NS_IMETHODIMP
GetMessageIdProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapExtensionSink->GetMessageId(
m_proxy->m_protocol, m_messageId, m_Url);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
nsImapMiscellaneousSinkProxyEvent::nsImapMiscellaneousSinkProxyEvent(
nsImapMiscellaneousSinkProxy* aProxy)
{
NS_ASSERTION (aProxy, "fatal: a null imap miscellaneous proxy");
m_proxy = aProxy;
NS_IF_ADDREF (m_proxy);
}
nsImapMiscellaneousSinkProxyEvent::~nsImapMiscellaneousSinkProxyEvent()
{
NS_IF_RELEASE (m_proxy);
}
HeaderFetchCompletedProxyEvent::HeaderFetchCompletedProxyEvent(
nsImapMiscellaneousSinkProxy* aProxy) :
nsImapMiscellaneousSinkProxyEvent(aProxy)
{
}
HeaderFetchCompletedProxyEvent::~HeaderFetchCompletedProxyEvent()
{
}
NS_IMETHODIMP
HeaderFetchCompletedProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapMiscellaneousSink->HeaderFetchCompleted(
m_proxy->m_protocol);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
SetBiffStateAndUpdateProxyEvent::SetBiffStateAndUpdateProxyEvent(
nsImapMiscellaneousSinkProxy* aProxy, nsMsgBiffState biffState) :
nsImapMiscellaneousSinkProxyEvent(aProxy)
{
m_biffState = biffState;
}
SetBiffStateAndUpdateProxyEvent::~SetBiffStateAndUpdateProxyEvent()
{
}
NS_IMETHODIMP
SetBiffStateAndUpdateProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapMiscellaneousSink->SetBiffStateAndUpdate(
m_proxy->m_protocol, m_biffState);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
ProgressStatusProxyEvent::ProgressStatusProxyEvent(
nsImapMiscellaneousSinkProxy* aProxy, PRUint32 aMsgId, const PRUnichar *extraInfo) :
nsImapMiscellaneousSinkProxyEvent(aProxy)
{
m_statusMsgId = aMsgId;
m_extraInfo = (extraInfo) ? nsCRT::strdup(extraInfo) : nsnull;
}
ProgressStatusProxyEvent::~ProgressStatusProxyEvent()
{
if (m_extraInfo)
nsCRT::free(m_extraInfo);
}
NS_IMETHODIMP
ProgressStatusProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapMiscellaneousSink->ProgressStatus(
m_proxy->m_protocol, m_statusMsgId, m_extraInfo);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}
PercentProgressProxyEvent::PercentProgressProxyEvent(
nsImapMiscellaneousSinkProxy* aProxy, ProgressInfo* aInfo) :
nsImapMiscellaneousSinkProxyEvent(aProxy)
{
NS_ASSERTION (aInfo, "Oops... a null progress info");
if (aInfo)
{
m_progressInfo.message = (aInfo->message) ? nsCRT::strdup(aInfo->message) : nsnull;
m_progressInfo.currentProgress = aInfo->currentProgress;
m_progressInfo.maxProgress = aInfo->maxProgress;
}
else
{
m_progressInfo.message = nsnull;
m_progressInfo.maxProgress = -1;
m_progressInfo.currentProgress = 0;
}
}
PercentProgressProxyEvent::~PercentProgressProxyEvent()
{
if (m_progressInfo.message)
PR_Free(m_progressInfo.message);
}
NS_IMETHODIMP
PercentProgressProxyEvent::HandleEvent()
{
nsresult res = m_proxy->m_realImapMiscellaneousSink->PercentProgress(
m_proxy->m_protocol, &m_progressInfo);
if (m_notifyCompletion)
m_proxy->m_protocol->NotifyFEEventCompletion();
return res;
}

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

@ -44,7 +44,6 @@
#include "nsIURL.h"
#include "nsIImapMailFolderSink.h"
#include "nsIImapMessageSink.h"
#include "nsIImapExtensionSink.h"
#include "nsIImapMiscellaneousSink.h"
#include "nsIImapIncomingServer.h"
#include "nsImapCore.h"
@ -67,57 +66,6 @@ public:
nsIImapProtocol* m_protocol;
};
class nsImapExtensionSinkProxy : public nsIImapExtensionSink,
public nsImapProxyBase
{
public:
nsImapExtensionSinkProxy(nsIImapExtensionSink* aImapExtensionSink,
nsIImapProtocol* aProtocol,
nsIEventQueue* aEventQ,
PRThread* aThread);
virtual ~nsImapExtensionSinkProxy();
NS_DECL_ISUPPORTS
NS_IMETHOD ClearFolderRights(nsIImapProtocol* aProtocol,
nsIMAPACLRightsInfo* aclRights);
NS_IMETHOD SetCopyResponseUid(nsIImapProtocol* aProtocol,
nsMsgKeyArray* aKeyArray,
const char* msgIdString,
nsIImapUrl * aUrl);
NS_IMETHOD SetAppendMsgUid(nsIImapProtocol* aProtocol,
nsMsgKey aKey,
nsIImapUrl * aUrl);
NS_IMETHOD GetMessageId(nsIImapProtocol* aProtocol,
nsCString* messageId,
nsIImapUrl * aUrl);
nsIImapExtensionSink* m_realImapExtensionSink;
};
class nsImapMiscellaneousSinkProxy : public nsIImapMiscellaneousSink,
public nsImapProxyBase
{
public:
nsImapMiscellaneousSinkProxy (nsIImapMiscellaneousSink* aImapMiscellaneousSink,
nsIImapProtocol* aProtocol,
nsIEventQueue* aEventQ,
PRThread* aThread);
~nsImapMiscellaneousSinkProxy ();
NS_DECL_ISUPPORTS
NS_IMETHOD HeaderFetchCompleted(nsIImapProtocol* aProtocol);
// ****
NS_IMETHOD SetBiffStateAndUpdate(nsIImapProtocol* aProtocol,
nsMsgBiffState biffState);
NS_IMETHOD ProgressStatus(nsIImapProtocol* aProtocol,
PRUint32 statusMsgId, const PRUnichar *extraInfo);
NS_IMETHOD PercentProgress(nsIImapProtocol* aProtocol,
ProgressInfo* aInfo);
nsIImapMiscellaneousSink* m_realImapMiscellaneousSink;
};
/* ******* Imap Base Event struct ******** */
struct nsImapEvent : public PLEvent
{
@ -134,95 +82,5 @@ struct nsImapEvent : public PLEvent
PRBool m_notifyCompletion;
};
struct nsImapExtensionSinkProxyEvent : nsImapEvent
{
nsImapExtensionSinkProxyEvent(nsImapExtensionSinkProxy* aProxy);
virtual ~nsImapExtensionSinkProxyEvent();
nsImapExtensionSinkProxy* m_proxy;
};
struct ClearFolderRightsProxyEvent : nsImapExtensionSinkProxyEvent
{
ClearFolderRightsProxyEvent(nsImapExtensionSinkProxy* aProxy,
nsIMAPACLRightsInfo* aclRights);
virtual ~ClearFolderRightsProxyEvent();
NS_IMETHOD HandleEvent();
nsIMAPACLRightsInfo m_aclRightsInfo;
};
struct SetCopyResponseUidProxyEvent : nsImapExtensionSinkProxyEvent
{
SetCopyResponseUidProxyEvent(nsImapExtensionSinkProxy* aProxy,
nsMsgKeyArray* aKeyArray,
const char* msgIdString,
nsIImapUrl * aUr);
virtual ~SetCopyResponseUidProxyEvent();
NS_IMETHOD HandleEvent();
nsMsgKeyArray m_copyKeyArray;
nsCString m_msgIdString;
nsCOMPtr<nsIImapUrl> m_Url;
};
struct SetAppendMsgUidProxyEvent : nsImapExtensionSinkProxyEvent
{
SetAppendMsgUidProxyEvent(nsImapExtensionSinkProxy* aProxy,
nsMsgKey aKey, nsIImapUrl * aUrl);
virtual ~SetAppendMsgUidProxyEvent();
NS_IMETHOD HandleEvent();
nsMsgKey m_key;
nsCOMPtr<nsIImapUrl> m_Url;
};
struct GetMessageIdProxyEvent : nsImapExtensionSinkProxyEvent
{
GetMessageIdProxyEvent(nsImapExtensionSinkProxy* aProxy,
nsCString* messageId, nsIImapUrl * aUrl);
virtual ~GetMessageIdProxyEvent();
NS_IMETHOD HandleEvent();
nsCString* m_messageId;
nsCOMPtr<nsIImapUrl> m_Url;
};
struct nsImapMiscellaneousSinkProxyEvent : public nsImapEvent
{
nsImapMiscellaneousSinkProxyEvent(nsImapMiscellaneousSinkProxy* aProxy);
virtual ~nsImapMiscellaneousSinkProxyEvent();
nsImapMiscellaneousSinkProxy* m_proxy;
};
struct HeaderFetchCompletedProxyEvent : public nsImapMiscellaneousSinkProxyEvent
{
HeaderFetchCompletedProxyEvent(nsImapMiscellaneousSinkProxy* aProxy);
virtual ~HeaderFetchCompletedProxyEvent();
NS_IMETHOD HandleEvent();
};
struct SetBiffStateAndUpdateProxyEvent : public nsImapMiscellaneousSinkProxyEvent
{
SetBiffStateAndUpdateProxyEvent(nsImapMiscellaneousSinkProxy* aProxy,
nsMsgBiffState biffState);
virtual ~SetBiffStateAndUpdateProxyEvent();
NS_IMETHOD HandleEvent();
nsMsgBiffState m_biffState;
};
struct ProgressStatusProxyEvent : public nsImapMiscellaneousSinkProxyEvent
{
ProgressStatusProxyEvent(nsImapMiscellaneousSinkProxy* aProxy,
PRUint32 statusMsgId, const PRUnichar *extraInfo);
virtual ~ProgressStatusProxyEvent();
NS_IMETHOD HandleEvent();
PRUint32 m_statusMsgId;
PRUnichar *m_extraInfo;
};
struct PercentProgressProxyEvent : public nsImapMiscellaneousSinkProxyEvent
{
PercentProgressProxyEvent(nsImapMiscellaneousSinkProxy* aProxy,
ProgressInfo* aInfo);
virtual ~PercentProgressProxyEvent();
NS_IMETHOD HandleEvent();
ProgressInfo m_progressInfo;
};
#endif

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

@ -113,7 +113,6 @@ nsImapServerResponseParser::~nsImapServerResponseParser()
PR_Free(fAuthChallenge);
NS_IF_RELEASE (fHostSessionList);
fCopyResponseKeyArray.RemoveAll();
}
PRBool nsImapServerResponseParser::LastCommandSuccessful()
@ -1928,20 +1927,7 @@ void nsImapServerResponseParser::resp_text_code()
// either uid or uid1:uid2
AdvanceToNextToken();
// clear copy response uid
fCopyResponseKeyArray.RemoveAll();
PRUint32 startKey = atoi(fNextToken);
fCopyResponseKeyArray.Add(startKey);
char *colon = PL_strchr(fNextToken, ':');
if (colon)
{
PRUint32 endKey= atoi(colon+1);
NS_ASSERTION (endKey > startKey,
"Oops ... invalid message set");
for (startKey++; startKey <= endKey; startKey++)
fCopyResponseKeyArray.Add(startKey);
}
fServerConnection.SetCopyResponseUid(
&fCopyResponseKeyArray, fNextToken);
fServerConnection.SetCopyResponseUid(fNextToken);
}
if (ContinueParse())
AdvanceToNextToken();
@ -2900,19 +2886,6 @@ nsImapServerResponseParser::GetHostSessionList()
return fHostSessionList;
}
void
nsImapServerResponseParser::CopyResponseUID(nsMsgKeyArray& keyArray)
{
keyArray.CopyArray(fCopyResponseKeyArray);
}
void
nsImapServerResponseParser::ClearCopyResponseUID()
{
fCopyResponseKeyArray.RemoveAll();
}
void nsImapServerResponseParser::SetSyntaxError(PRBool error)
{
nsIMAPGenericParser::SetSyntaxError(error);

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

@ -96,8 +96,6 @@ public:
PRUint32 CurrentResponseUID();
PRUint32 HighestRecordedUID();
void SetCurrentResponseUID(PRUint32 uid);
void CopyResponseUID(nsMsgKeyArray& keyArray);
void ClearCopyResponseUID();
PRBool IsNumericString(const char *string);
PRInt32 SizeOfMostRecentMessage();
void SetTotalDownloadSize(PRInt32 newSize) { fTotalDownloadSize = newSize; }

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

@ -1779,20 +1779,6 @@ nsImapService::SetImapUrlSink(nsIMsgFolder* aMsgFolder,
NS_IF_RELEASE (aInst);
aInst = nsnull;
rv = aMsgFolder->QueryInterface(NS_GET_IID(nsIImapExtensionSink),
(void**)&aInst);
if (NS_SUCCEEDED(rv) && aInst)
aImapUrl->SetImapExtensionSink((nsIImapExtensionSink*) aInst);
NS_IF_RELEASE (aInst);
aInst = nsnull;
rv = aMsgFolder->QueryInterface(NS_GET_IID(nsIImapMiscellaneousSink),
(void**)&aInst);
if (NS_SUCCEEDED(rv) && aInst)
aImapUrl->SetImapMiscellaneousSink((nsIImapMiscellaneousSink*) aInst);
NS_IF_RELEASE (aInst);
aInst = nsnull;
nsCOMPtr <nsIMsgMailNewsUrl> mailnewsUrl = do_QueryInterface(aImapUrl);
mailnewsUrl->SetFolder(aMsgFolder);
@ -2053,7 +2039,7 @@ nsImapService::OnlineMessageCopy(nsIEventQueue* aClientEventQueue,
urlSpec.Append(messageIds);
urlSpec.Append('>');
urlSpec.Append(char(hierarchySeparator));
folderName.Adopt(nsCRT::strdup(""));
folderName.Adopt(strdup(""));
GetFolderName(aDstFolder, getter_Copies(folderName));
urlSpec.Append((const char *) folderName);
@ -2322,7 +2308,7 @@ nsImapService::MoveFolder(nsIEventQueue* eventQueue, nsIMsgFolder* srcFolder,
urlSpec.Append(hierarchySeparator);
urlSpec.Append((const char *) folderName);
urlSpec.Append('>');
folderName.Adopt(nsCRT::strdup(""));
folderName.Adopt(strdup(""));
GetFolderName(dstFolder, getter_Copies(folderName));
if ( folderName && folderName[0])
{

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

@ -217,7 +217,7 @@ nsImapMoveCopyMsgTxn::UndoTransaction(void)
PR_TRUE);
}
}
if (m_dstKeyArray.GetSize() > 0)
if (!m_dstMsgIdString.IsEmpty())
{
nsCOMPtr<nsIMsgFolder> dstFolder = do_QueryReferent(m_dstFolder, &rv);
if (NS_FAILED(rv) || !dstFolder) return rv;
@ -294,7 +294,7 @@ nsImapMoveCopyMsgTxn::RedoTransaction(void)
kImapMsgDeletedFlag, m_idsAreUids);
}
}
if (m_dstKeyArray.GetSize() > 0)
if (!m_dstMsgIdString.IsEmpty())
{
nsCOMPtr<nsIMsgFolder> dstFolder = do_QueryReferent(m_dstFolder, &rv);
if (NS_FAILED(rv) || !dstFolder) return rv;
@ -329,11 +329,9 @@ nsImapMoveCopyMsgTxn::RedoTransaction(void)
}
nsresult
nsImapMoveCopyMsgTxn::SetCopyResponseUid(nsMsgKeyArray* aKeyArray,
const char* aMsgIdString)
nsImapMoveCopyMsgTxn::SetCopyResponseUid(const char* aMsgIdString)
{
if (!aKeyArray || !aMsgIdString) return NS_ERROR_NULL_POINTER;
m_dstKeyArray.CopyArray(aKeyArray);
if (!aMsgIdString) return NS_ERROR_NULL_POINTER;
m_dstMsgIdString = aMsgIdString;
if (m_dstMsgIdString.Last() == ']')
{
@ -350,17 +348,9 @@ nsImapMoveCopyMsgTxn::GetSrcKeyArray(nsMsgKeyArray& srcKeyArray)
return NS_OK;
}
nsresult
nsImapMoveCopyMsgTxn::GetDstKeyArray(nsMsgKeyArray& dstKeyArray)
{
dstKeyArray.CopyArray(&m_dstKeyArray);
return NS_OK;
}
nsresult
nsImapMoveCopyMsgTxn::AddDstKey(nsMsgKey aKey)
{
m_dstKeyArray.Add(aKey);
if (!m_dstMsgIdString.IsEmpty())
m_dstMsgIdString.Append(",");
m_dstMsgIdString.AppendInt((PRInt32) aKey);

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

@ -74,10 +74,8 @@ public:
NS_IMETHOD RedoTransaction(void);
// helper
nsresult SetCopyResponseUid(nsMsgKeyArray* keyArray,
const char *msgIdString);
nsresult SetCopyResponseUid(const char *msgIdString);
nsresult GetSrcKeyArray(nsMsgKeyArray& srcKeyArray);
nsresult GetDstKeyArray(nsMsgKeyArray& dstKeyArray);
nsresult AddDstKey(nsMsgKey aKey);
nsresult UndoMailboxDelete();
nsresult RedoMailboxDelete();
@ -95,7 +93,6 @@ protected:
nsMsgKeyArray m_srcKeyArray;
nsCString m_srcMsgIdString;
nsWeakPtr m_dstFolder;
nsMsgKeyArray m_dstKeyArray;
nsCString m_dstMsgIdString;
nsCOMPtr<nsIEventQueue> m_eventQueue;
nsCOMPtr<nsIUrlListener> m_urlListener;

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

@ -101,8 +101,6 @@ nsImapUrl::nsImapUrl()
m_fileSpec = nsnull;
m_imapMailFolderSink = nsnull;
m_imapMessageSink = nsnull;
m_imapExtensionSink = nsnull;
m_imapMiscellaneousSink = nsnull;
m_addDummyEnvelope = PR_FALSE;
m_canonicalLineEnding = PR_FALSE;
}
@ -276,44 +274,6 @@ NS_IMETHODIMP nsImapUrl::SetImapServerSink(nsIImapServerSink * aImapServerSink)
return rv;
}
NS_IMETHODIMP nsImapUrl::GetImapExtensionSink(nsIImapExtensionSink ** aImapExtensionSink)
{
NS_ENSURE_ARG_POINTER(aImapExtensionSink);
NS_ENSURE_ARG_POINTER(m_imapExtensionSink);
nsCOMPtr<nsIImapExtensionSink> extensionSink = do_QueryReferent(m_imapExtensionSink);
*aImapExtensionSink = extensionSink;
NS_IF_ADDREF(*aImapExtensionSink);
return NS_OK;
}
NS_IMETHODIMP nsImapUrl::SetImapExtensionSink(nsIImapExtensionSink * aImapExtensionSink)
{
nsresult rv;
m_imapExtensionSink = do_GetWeakReference(aImapExtensionSink, &rv);
return rv;
}
NS_IMETHODIMP nsImapUrl::GetImapMiscellaneousSink(nsIImapMiscellaneousSink **
aImapMiscellaneousSink)
{
NS_ENSURE_ARG_POINTER(aImapMiscellaneousSink);
NS_ENSURE_ARG_POINTER(m_imapMiscellaneousSink);
nsCOMPtr<nsIImapMiscellaneousSink> miscSink = do_QueryReferent(m_imapMiscellaneousSink);
*aImapMiscellaneousSink = miscSink;
NS_IF_ADDREF(*aImapMiscellaneousSink);
return NS_OK;
}
NS_IMETHODIMP nsImapUrl::SetImapMiscellaneousSink(nsIImapMiscellaneousSink *
aImapMiscellaneousSink)
{
nsresult rv;
m_imapMiscellaneousSink = do_GetWeakReference(aImapMiscellaneousSink, &rv);
return rv;
}
////////////////////////////////////////////////////////////////////////////////////
// End nsIImapUrl specific support

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

@ -46,8 +46,6 @@
#include "nsIImapMailFolderSink.h"
#include "nsIImapServerSink.h"
#include "nsIImapMessageSink.h"
#include "nsIImapExtensionSink.h"
#include "nsIImapMiscellaneousSink.h"
#include "nsWeakPtr.h"
#include "nsXPIDLString.h"
@ -139,8 +137,6 @@ protected:
nsWeakPtr m_imapFolder;
nsWeakPtr m_imapMailFolderSink;
nsWeakPtr m_imapMessageSink;
nsWeakPtr m_imapExtensionSink;
nsWeakPtr m_imapMiscellaneousSink;
nsWeakPtr m_imapServerSink;