Added ability to create a message.

This commit is contained in:
putterman%netscape.com 1999-04-24 20:44:40 +00:00
Родитель 64a1a062a8
Коммит 5d9639ccc0
2 изменённых файлов: 29 добавлений и 1 удалений

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

@ -36,4 +36,10 @@
0xd2876e51, 0xe62c, 0x11d2, \
{0xb7, 0xfc, 0x0, 0x80, 0x5f, 0x5, 0xff, 0xa5 }}
#define NS_MAILBOXMESSAGERESOURCE_CID \
{ /* b0908e06-dc06-11d2-8a46-0060b0fc04d2*/ \
0xb0908e06,0xdc06, 0x11d2, \
{0x8a, 0x46, 0x00, 0x60, 0xb0, 0xfc, 0x4, 0xd2} }
#endif // nsMsgLocalCID_h__

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

@ -32,12 +32,14 @@
#include "nsPop3Service.h"
#include "nsPop3IncomingServer.h"
#include "nsCOMPtr.h"
#include "nsLocalMessage.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kMailboxUrlCID, NS_MAILBOXURL_CID);
static NS_DEFINE_CID(kMailboxParserCID, NS_MAILBOXPARSER_CID);
static NS_DEFINE_CID(kMailboxServiceCID, NS_MAILBOXSERVICE_CID);
static NS_DEFINE_CID(kLocalMailFolderResourceCID, NS_LOCALMAILFOLDERRESOURCE_CID);
static NS_DEFINE_CID(kMailboxMessageResourceCID, NS_MAILBOXMESSAGERESOURCE_CID);
static NS_DEFINE_CID(kPop3ServiceCID, NS_POP3SERVICE_CID);
static NS_DEFINE_CID(kPop3UrlCID, NS_POP3URL_CID);
static NS_DEFINE_CID(kPop3IncomingServerCID, NS_POP3INCOMINGSERVER_CID);
@ -183,7 +185,18 @@ nsresult nsMsgLocalFactory::CreateInstance(nsISupports *aOuter, const nsIID &aII
if (NS_FAILED(rv) && localFolder)
delete localFolder;
}
}
else if (mClassID.Equals(kMailboxMessageResourceCID))
{
nsLocalMessage * localMessage = new nsLocalMessage();
if (localMessage)
rv = localMessage->QueryInterface(aIID, aResult);
else
rv = NS_ERROR_OUT_OF_MEMORY;
if (NS_FAILED(rv) && localMessage)
delete localMessage;
}
else if (mClassID.Equals(kPop3IncomingServerCID))
rv = NS_NewPop3IncomingServer(nsISupports::GetIID(), aResult);
else
@ -281,6 +294,12 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) goto done;
rv = compMgr->RegisterComponent(kMailboxMessageResourceCID,
"Local Message Resource Factory",
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "mailbox_message",
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) goto done;
rv = compMgr->RegisterComponent(kPop3IncomingServerCID,
"Pop3 Incoming Server",
"component://netscape/messenger/server&type=pop3",
@ -325,6 +344,9 @@ NSUnregisterSelf(nsISupports* aServMgr, const char* path)
rv = compMgr->UnregisterComponent(kLocalMailFolderResourceCID, path);
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterComponent(kMailboxMessageResourceCID, path);
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterComponent(kPop3IncomingServerCID, path);
if (NS_FAILED(rv)) goto done;