Add work for SentUnsentMessages.

git-svn-id: svn://10.0.0.236/trunk@34869 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
putterman%netscape.com
1999-06-11 22:10:02 +00:00
parent ba23b98a81
commit 25b556e8bf

View File

@@ -69,6 +69,10 @@
#include "nsTransactionManagerCID.h"
#include "nsITransactionManager.h"
#include "nsIMsgSendLater.h"
#include "nsMsgCompCID.h"
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
static NS_DEFINE_CID(kCPop3ServiceCID, NS_POP3SERVICE_CID);
static NS_DEFINE_CID(kRDFServiceCID, NS_RDFSERVICE_CID);
@@ -77,6 +81,7 @@ static NS_DEFINE_CID(kNetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
static NS_DEFINE_CID(kTransactionManagerCID, NS_TRANSACTIONMANAGER_CID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kMsgSendLaterCID, NS_MSGSENDLATER_CID);
// we need this because of an egcs 1.0 (and possibly gcc) compiler bug
// that doesn't allow you to call ::nsISupports::GetIID() inside of a class
@@ -118,6 +123,7 @@ public:
const char *name);
NS_IMETHOD Undo();
NS_IMETHOD Redo();
NS_IMETHOD SendUnsentMessages();
protected:
nsresult DoDelete(nsIRDFCompositeDataSource* db, nsISupportsArray *srcArray, nsISupportsArray *deletedArray);
@@ -846,3 +852,21 @@ nsMessenger::GetTransactionManager(nsITransactionManager* *aTxnMgr)
return NS_OK;
}
NS_IMETHODIMP
nsMessenger::SendUnsentMessages()
{
nsresult rv;
nsCOMPtr<nsIMsgSendLater> pMsgSendLater;
rv = nsComponentManager::CreateInstance(kMsgSendLaterCID, NULL,nsIMsgSendLater::GetIID(),
(void **)getter_AddRefs(pMsgSendLater));
if (NS_SUCCEEDED(rv) && pMsgSendLater)
{
printf("We succesfully obtained a nsIMsgSendLater interface....\n");
pMsgSendLater->SendUnsentMessages(nsnull);
}
return NS_OK;
}