167560 r=cavin sr=bienvenu make remaining cases of copyMessages go through copy service

This commit is contained in:
naving%netscape.com 2002-09-11 01:54:13 +00:00
parent 04efa431f3
commit e4a0d79697
2 changed files with 11 additions and 4 deletions

View File

@ -61,6 +61,8 @@
#include "nsIPrefBranchInternal.h"
#include "nsIPrefLocalizedString.h"
#include "nsIMsgSearchSession.h"
#include "nsIMsgCopyService.h"
#include "nsMsgBaseCID.h"
/* Implementation file */
static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
@ -1977,7 +1979,9 @@ nsMsgDBView::CopyMessages(nsIMsgWindow *window, nsMsgViewIndex *indices, PRInt32
messageArray->AppendElement(msgHdr);
}
m_deletingRows = isMove && mDeleteModel != nsMsgImapDeleteModels::IMAPDelete;
rv = destFolder->CopyMessages(m_folder /* source folder */, messageArray, isMove, window, nsnull /* listener */, PR_FALSE /* isFolder */, PR_TRUE /*allowUndo*/);
nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = copyService->CopyMessages(m_folder /* source folder */, messageArray, destFolder, isMove, nsnull /* listener */, window, PR_TRUE /*allowUndo*/);
return rv;
}

View File

@ -41,6 +41,8 @@
#include "nsImapMoveCoalescer.h"
#include "nsMsgKeyArray.h"
#include "nsImapService.h"
#include "nsIMsgCopyService.h"
#include "nsMsgBaseCID.h"
#include "nsIMsgFolder.h" // TO include biffState enum. Change to bool later...
static NS_DEFINE_CID(kCImapService, NS_IMAPSERVICE_CID);
@ -149,9 +151,10 @@ nsresult nsImapMoveCoalescer::PlaybackMoves(nsIEventQueue *eventQueue)
messages->AppendElement(iSupports);
}
}
rv = destFolder->CopyMessages(m_sourceFolder,
messages, PR_TRUE, m_msgWindow,
/*nsIMsgCopyServiceListener* listener*/ nsnull, PR_FALSE, PR_FALSE /*allowUndo*/);
nsCOMPtr<nsIMsgCopyService> copySvc = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID);
if (copySvc)
rv = copySvc->CopyMessages(m_sourceFolder, messages, destFolder, PR_TRUE,
/*nsIMsgCopyServiceListener* listener*/ nsnull, m_msgWindow, PR_FALSE /*allowUndo*/);
// rv = imapService->OnlineMessageCopy(eventQueue,
// m_sourceFolder, messageIds.get(),
// destFolder, PR_TRUE, PR_TRUE,