rework nsMessages so they are generic across all server/folder types, so that we can recycle them later

r=putterman
for bug #26456
This commit is contained in:
alecf%netscape.com 2000-08-16 23:45:58 +00:00
Родитель 82a9fe31a4
Коммит ebc5b3c4b7
19 изменённых файлов: 83 добавлений и 93 удалений

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

@ -44,6 +44,7 @@ LLIBS= \
$(DIST)\lib\msgbase_s.lib \
$(DIST)\lib\msgsearch_s.lib \
$(DIST)\lib\timer_s.lib \
$(DIST)\lib\rdfutil_s.lib \
$(LIBNSPR) \
$(NULL)

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

@ -27,16 +27,6 @@
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#define NS_MSGFOLDEREVENT_CID \
{ /* FBFEBE7A-C1DD-11d2-8A40-0060B0FC04D2 */ \
0xfbfebe7a, 0xc1dd, 0x11d2, \
{0x8a, 0x40, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0xd2}}
#define NS_MSGGROUPRECORD_CID \
{ /* a8f54ee0-d292-11d2-b7f6-00805f05ffa5 */ \
0xa8f54ee0, 0xd292, 0x11d2, \
{0xb7, 0xf6, 0x00, 0x80, 0x5f, 0x05, 0xff, 0xa5}}
//
// nsMsgFolderDataSource
//
@ -310,6 +300,27 @@
{ 0xbb460dff, 0x8bf0, 0x11d3, \
{ 0x8a, 0xfe, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0xd2}}
//
// nsMessage
//
/* {44C0D336-796D-42ee-B8B7-6FA3DE372E7E} */
#define NS_MESSAGE_CID \
{ 0x44c0d336, 0x796d, 0x42ee, \
{ 0xb8, 0xb7, 0x6f, 0xa3, 0xde, 0x37, 0x2e, 0x7e } }
#define NS_MESSAGE_MAILBOX_PROGID \
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "mailbox_message"
#define NS_MESSAGE_NEWS_PROGID \
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "news_message"
#define NS_MESSAGE_IMAP_PROGID \
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "imap_message"
//
//nsMsgViewNavigationService
//

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

@ -73,6 +73,7 @@
#include "nsMsgFilterDelegateFactory.h"
#include "nsMessageView.h"
#include "nsMsgWindow.h"
#include "nsMessage.h"
#include "nsMsgViewNavigationService.h"
#include "nsMsgServiceProvider.h"
@ -113,6 +114,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgFolderCache)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgStatusFeedback)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMessageView,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgWindow,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMessage)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgViewNavigationService,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgServiceProviderService, Init);
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSubscribeDataSource, Init);
@ -250,6 +252,18 @@ static nsModuleComponentInfo gComponents[] = {
NS_MSGWINDOW_PROGID,
nsMsgWindowConstructor,
},
{ "Message Resource", NS_MESSAGE_CID,
NS_MESSAGE_MAILBOX_PROGID,
nsMessageConstructor,
},
{ "Message Resource", NS_MESSAGE_CID,
NS_MESSAGE_IMAP_PROGID,
nsMessageConstructor,
},
{ "Message Resource", NS_MESSAGE_CID,
NS_MESSAGE_NEWS_PROGID,
nsMessageConstructor,
},
{ "Mail/News Message Navigation Service", NS_MSGVIEWNAVIGATIONSERVICE_CID,
NS_MSGVIEWNAVIGATIONSERVICE_PROGID,
nsMsgViewNavigationServiceConstructor,

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

@ -33,7 +33,7 @@ interface nsIMessage : nsIMsgHdr {
//copying around so I'm using these constants and making them part of the base interface.
const unsigned long MailMessage = 0;
const unsigned long NewsMessage = 1;
readonly attribute unsigned long messageType;
attribute unsigned long messageType;
};

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

@ -592,7 +592,13 @@ NS_IMETHODIMP nsMessage::GetMsgKey(nsMsgKey *aMsgKey)
NS_IMETHODIMP nsMessage::GetMessageType(PRUint32 *aMessageType)
{
// base classes need to define this
return NS_ERROR_NOT_IMPLEMENTED;
NS_ENSURE_ARG_POINTER(aMessageType);
*aMessageType = mMessageType;
return NS_OK;
}
NS_IMETHODIMP nsMessage::SetMessageType(PRUint32 aMessageType)
{
mMessageType = aMessageType;
return NS_OK;
}

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

@ -55,7 +55,10 @@ protected:
private:
nsWeakPtr mFolder;
nsMsgKey mMsgKey;
// could be combined into bitfield
PRBool mMsgKeyValid;
PRUint32 mMessageType;
};
#endif //nsMessage_h__

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

@ -40,7 +40,6 @@ EXPORTS= nsImapUrl.h \
nsImapIncomingServer.h \
nsIMAPNamespace.h \
nsImapMailFolder.h \
nsImapMessage.h \
$(NULL)
################################################################################
@ -61,7 +60,6 @@ CPP_OBJS= .\$(OBJDIR)\nsImapUrl.obj \
.\$(OBJDIR)\nsImapService.obj \
.\$(OBJDIR)\nsImapIncomingServer.obj \
.\$(OBJDIR)\nsImapMailFolder.obj \
.\$(OBJDIR)\nsImapMessage.obj \
.\$(OBJDIR)\nsImapMoveCoalescer.obj \
.\$(OBJDIR)\nsImapUtils.obj \
.\$(OBJDIR)\nsImapUndoTxn.obj \

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

@ -700,7 +700,8 @@ NS_IMETHODIMP nsIMAPHostSessionList::GetOnlineInboxPathForHost(const char *serve
ns = host->fNamespaceList->GetDefaultNamespaceOfType(kPersonalNamespace);
if (ns)
{
result.AssignWithConversion(PR_smprintf("%sINBOX",ns->GetPrefix()));
result.AssignWithConversion(ns->GetPrefix());
result.AppendWithConversion("INBOX");
}
}
else

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

@ -42,7 +42,6 @@
#include "nsImapUtils.h"
#include "nsMsgUtils.h"
#include "nsIMsgMailSession.h"
#include "nsImapMessage.h"
#include "nsMsgBaseCID.h"
#include "nsMsgLocalCID.h"
#include "nsImapUndoTxn.h"
@ -1159,7 +1158,7 @@ nsImapMailFolder::MarkMessagesRead(nsISupportsArray *messages, PRBool markRead)
rv = nsMsgFolder::MarkMessagesRead(messages, markRead);
if (NS_SUCCEEDED(rv))
{
nsCString messageIds;
nsCAutoString messageIds;
nsMsgKeyArray keysToMarkRead;
rv = BuildIdsAndKeyArray(messages, messageIds, keysToMarkRead);
if (NS_FAILED(rv)) return rv;
@ -1248,7 +1247,7 @@ nsImapMailFolder::MarkMessagesFlagged(nsISupportsArray *messages, PRBool markFla
rv = nsMsgFolder::MarkMessagesFlagged(messages, markFlagged);
if (NS_SUCCEEDED(rv))
{
nsCString messageIds;
nsCAutoString messageIds;
nsMsgKeyArray keysToMarkFlagged;
rv = BuildIdsAndKeyArray(messages, messageIds, keysToMarkFlagged);
if (NS_FAILED(rv)) return rv;
@ -1454,9 +1453,9 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMessages(nsISupportsArray *messages,
// *** jt - assuming delete is move to the trash folder for now
nsCOMPtr<nsIEnumerator> aEnumerator;
nsCOMPtr<nsIRDFResource> res;
nsCString uri;
nsCAutoString uri;
PRBool deleteImmediatelyNoTrash = PR_FALSE;
nsCString messageIds;
nsCAutoString messageIds;
nsMsgKeyArray srcKeyArray;
nsMsgImapDeleteModel deleteModel = nsMsgImapDeleteModels::MoveToTrash;
@ -1523,21 +1522,23 @@ NS_IMETHODIMP nsImapMailFolder::DeleteMessages(nsISupportsArray *messages,
rv = StoreImapFlags(kImapMsgDeletedFlag, PR_TRUE, srcKeyArray);
if (NS_SUCCEEDED(rv))
{
if (mDatabase)
{
if (deleteModel == nsMsgImapDeleteModels::IMAPDelete)
if (mDatabase)
{
MarkMessagesImapDeleted(&srcKeyArray, PR_TRUE, mDatabase);
if (deleteModel == nsMsgImapDeleteModels::IMAPDelete)
{
MarkMessagesImapDeleted(&srcKeyArray, PR_TRUE, mDatabase);
}
else
{
mDatabase->DeleteMessages(&srcKeyArray,NULL);
NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
}
}
else
{
mDatabase->DeleteMessages(&srcKeyArray,NULL);
NotifyFolderEvent(mDeleteOrMoveMsgCompletedAtom);
}
}
}
return rv;
}
}
return rv;
}
// have to move the messages to the trash
else
{
if(trashFolder)
@ -2069,6 +2070,7 @@ NS_IMETHODIMP nsImapMailFolder::CreateMessageFromMsgDBHdr(nsIMsgDBHdr *msgDBHdr,
if(messageResource)
{
messageResource->SetMsgDBHdr(msgDBHdr);
messageResource->SetMessageType(nsIMessage::MailMessage);
*message = messageResource;
NS_IF_ADDREF(*message);
}
@ -2394,19 +2396,16 @@ nsresult nsImapMailFolder::StoreImapFlags(imapMessageFlagsType flags, PRBool add
NS_WITH_SERVICE(nsIImapService, imapService, kCImapService, &rv);
if (NS_SUCCEEDED(rv))
{
nsCAutoString msgIds;
AllocateUidStringFromKeyArray(keysToFlag, msgIds);
if (addFlags)
{
nsCString msgIds;
AllocateUidStringFromKeyArray(keysToFlag, msgIds);
imapService->AddMessageFlags(m_eventQueue, this, this,
nsnull, msgIds, flags, PR_TRUE);
}
else
{
nsCString msgIds;
AllocateUidStringFromKeyArray(keysToFlag, msgIds);
imapService->SubtractMessageFlags(m_eventQueue, this, this,
nsnull, msgIds, flags,
PR_TRUE);
@ -2743,7 +2742,7 @@ nsImapMailFolder::SetupMsgWriteStream(const char * aNativeString, PRBool addDumm
m_tempMessageStream = do_QueryInterface(supports);
if (m_tempMessageStream && addDummyEnvelope)
{
nsCString result;
nsCAutoString result;
char *ct;
PRUint32 writeCount;
time_t now = time ((time_t*) 0);
@ -3887,7 +3886,7 @@ nsImapMailFolder::CopyMessagesWithStream(nsIMsgFolder* srcFolder,
m_copyState->m_isCrossServerOp = isCrossServerOp;
// ** jt - needs to create server to server move/copy undo msg txn
nsCString messageIds;
nsCAutoString messageIds;
nsMsgKeyArray srcKeyArray;
nsCOMPtr<nsIUrlListener> urlListener;
@ -3941,7 +3940,7 @@ nsImapMailFolder::CopyMessages(nsIMsgFolder* srcFolder,
nsIMsgCopyServiceListener* listener)
{
nsresult rv = NS_OK;
nsCString messageIds;
nsCAutoString messageIds;
nsMsgKeyArray srcKeyArray;
nsCOMPtr<nsIUrlListener> urlListener;
nsCOMPtr<nsISupports> srcSupport;
@ -4032,7 +4031,7 @@ nsImapMailFolder::SetTransactionManager(nsITransactionManager* txnMgr)
{
nsresult rv = NS_OK;
if (txnMgr && !m_transactionManager)
m_transactionManager = do_QueryInterface(txnMgr, &rv);
m_transactionManager = txnMgr;
return rv;
}
@ -4045,7 +4044,7 @@ nsImapMailFolder::CopyFileMessage(nsIFileSpec* fileSpec,
{
nsresult rv = NS_ERROR_NULL_POINTER;
nsMsgKey key = 0xffffffff;
nsCString messageId;
nsCAutoString messageId;
nsCOMPtr<nsIUrlListener> urlListener;
nsCOMPtr<nsISupports> srcSupport;
nsCOMPtr<nsISupportsArray> messages;

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

@ -65,16 +65,6 @@
0xca5ffe7e, 0x5f47, 0x11d3, \
{0x9a, 0x51, 0x00, 0x40, 0x05, 0x26, 0x30, 0x78}}
//
// nsMailboxMessageResource
//
#define NS_MAILBOXMESSAGERESOURCE_PROGID \
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "mailbox_message"
#define NS_MAILBOXMESSAGERESOURCE_CID \
{ /* b0908e06-dc06-11d2-8a46-0060b0fc04d2*/ \
0xb0908e06,0xdc06, 0x11d2, \
{0x8a, 0x46, 0x00, 0x60, 0xb0, 0xfc, 0x4, 0xd2} }
//
// nsMsgMailboxService

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

@ -36,7 +36,6 @@
#include "nsNoneService.h"
#include "nsPop3IncomingServer.h"
#include "nsNoIncomingServer.h"
#include "nsLocalMessage.h"
#include "nsLocalStringBundle.h"
#include "nsCOMPtr.h"
@ -44,7 +43,6 @@ 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(kNoneServiceCID, NS_NONESERVICE_CID);
static NS_DEFINE_CID(kPop3UrlCID, NS_POP3URL_CID);
@ -63,7 +61,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMailboxService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPop3Service)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoneService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgLocalMailFolder)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLocalMessage)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParseMailMessageState)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPop3IncomingServer)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNoIncomingServer)
@ -93,7 +90,6 @@ protected:
nsCOMPtr<nsIGenericFactory> mPop3ServiceFactory;
nsCOMPtr<nsIGenericFactory> mNoneServiceFactory;
nsCOMPtr<nsIGenericFactory> mLocalMailFolderFactory;
nsCOMPtr<nsIGenericFactory> mLocalMessageFactory;
nsCOMPtr<nsIGenericFactory> mParseMailMsgStateFactory;
nsCOMPtr<nsIGenericFactory> mPop3IncomingServerFactory;
nsCOMPtr<nsIGenericFactory> mNoIncomingServerFactory;
@ -135,7 +131,6 @@ void nsMsgLocalModule::Shutdown()
mPop3ServiceFactory = null_nsCOMPtr();
mNoneServiceFactory = null_nsCOMPtr();
mLocalMailFolderFactory = null_nsCOMPtr();
mLocalMessageFactory = null_nsCOMPtr();
mParseMailMsgStateFactory = null_nsCOMPtr();
mPop3IncomingServerFactory = null_nsCOMPtr();
mNoIncomingServerFactory = null_nsCOMPtr();
@ -210,12 +205,6 @@ NS_IMETHODIMP nsMsgLocalModule::GetClassObject(nsIComponentManager *aCompMgr,
rv = NS_NewGenericFactory(getter_AddRefs(mLocalMailFolderFactory), &nsMsgLocalMailFolderConstructor);
fact = mLocalMailFolderFactory;
}
else if (aClass.Equals(kMailboxMessageResourceCID))
{
if (!mLocalMessageFactory)
rv = NS_NewGenericFactory(getter_AddRefs(mLocalMessageFactory), &nsLocalMessageConstructor);
fact = mLocalMessageFactory;
}
else if (aClass.Equals(kParseMailMsgStateCID))
{
if (!mParseMailMsgStateFactory)
@ -281,8 +270,6 @@ static Components gComponents[] = {
NS_NONEPROTOCOLINFO_PROGID },
{ "Local Mail Folder Resource Factory", &kLocalMailFolderResourceCID,
NS_LOCALMAILFOLDERRESOURCE_PROGID },
{ "Local Message Resource Factory", &kMailboxMessageResourceCID,
NS_MAILBOXMESSAGERESOURCE_PROGID },
{ "Pop3 Incoming Server", &kPop3IncomingServerCID,
NS_POP3INCOMINGSERVER_PROGID },
{ "No Incoming Server", &kNoIncomingServerCID,

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

@ -29,7 +29,6 @@ nsMailboxProtocol.h
nsMailboxService.h
nsPop3Service.h
nsPop3IncomingServer.h
nsLocalMessage.h
nsLocalStringBundle.h
nsNoneService.h
nsNoIncomingServer.h

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

@ -37,7 +37,6 @@ EXPORTS= \
nsMailboxService.h \
nsPop3Service.h \
nsPop3IncomingServer.h \
nsLocalMessage.h \
nsLocalMailFolder.h \
nsLocalUtils.h \
nsLocalStringBundle.h \
@ -62,7 +61,6 @@ CPP_OBJS= \
.\$(OBJDIR)\nsNoneService.obj \
.\$(OBJDIR)\nsLocalMailFolder.obj \
.\$(OBJDIR)\nsPop3IncomingServer.obj \
.\$(OBJDIR)\nsLocalMessage.obj \
.\$(OBJDIR)\nsLocalUtils.obj \
.\$(OBJDIR)\nsLocalUndoTxn.obj \
.\$(OBJDIR)\nsLocalStringBundle.obj \

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

@ -792,7 +792,8 @@ nsresult nsMsgLocalMailFolder::GetDatabase(nsIMsgWindow *aMsgWindow)
mDatabase->AddListener(this);
// if we have to regenerate the folder, run the parser url.
if(folderOpen == NS_MSG_ERROR_FOLDER_SUMMARY_MISSING || folderOpen == NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE)
if(folderOpen == NS_MSG_ERROR_FOLDER_SUMMARY_MISSING ||
folderOpen == NS_MSG_ERROR_FOLDER_SUMMARY_OUT_OF_DATE)
{
if(NS_FAILED(rv = ParseFolder(aMsgWindow, this)))
return rv;
@ -2054,6 +2055,7 @@ nsMsgLocalMailFolder::CreateMessageFromMsgDBHdr(nsIMsgDBHdr *msgDBHdr,
//We know from our factory that mailbox message resources are going to be
//nsLocalMessages.
dbMessage->SetMsgDBHdr(msgDBHdr);
dbMessage->SetMessageType(nsIMessage::MailMessage);
*message = dbMessage;
NS_IF_ADDREF(*message);
}

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

@ -42,9 +42,9 @@ LLIBS= \
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\js32$(VERSION_NUMBER).lib \
$(DIST)\lib\msgbsutl.lib \
$(DIST)\lib\rdfutil_s.lib \
$(DIST)\lib\msgnews_s.lib \
$(LIBNSPR) \
$(DIST)\lib\rdfutil_s.lib \
$(DIST)\lib\timer_s.lib \
$(NULL)

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

@ -38,17 +38,6 @@
{0x88, 0x0d, 0x00, 0x40, 0x05, 0x26, 0x30, 0x78} \
}
//
// nsNewsMessage
//
#define NS_NEWSMESSAGERESOURCE_PROGID \
NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "news_message"
#define NS_NEWSMESSAGERESOURCE_CID \
{ /* 2dae7f80-f104-11d2-973b-00805f916fd3 */ \
0x2dae7f80, 0xf104, 0x11d2, \
{0x97, 0x3b, 0x00, 0x80, 0x5f, 0x91, 0x6f, 0xd3} \
}
//
// nsNntpIncomingServer
//

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

@ -39,7 +39,6 @@
#include "nsNntpUrl.h"
#include "nsNntpService.h"
#include "nsNntpIncomingServer.h"
#include "nsNewsMessage.h"
#include "nsNNTPNewsgroup.h"
#include "nsNNTPNewsgroupPost.h"
#include "nsNNTPNewsgroupList.h"
@ -56,7 +55,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsNNTPHost)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNNTPNewsgroup)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNNTPNewsgroupPost)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNNTPNewsgroupList)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNewsMessage)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgNewsFolder)
static nsModuleComponentInfo components[] =
@ -103,10 +101,6 @@ static nsModuleComponentInfo components[] =
NS_NEWSFOLDERRESOURCE_CID,
NS_NEWSFOLDERRESOURCE_PROGID,
nsMsgNewsFolderConstructor },
{ "News Message Resource",
NS_NEWSMESSAGERESOURCE_CID,
NS_NEWSMESSAGERESOURCE_PROGID,
nsNewsMessageConstructor },
{ "NNTP Incoming Servier",
NS_NNTPINCOMINGSERVER_CID,
NS_NNTPINCOMINGSERVER_PROGID,

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

@ -37,7 +37,6 @@ EXPORTS= nsNNTPProtocol.h \
nsNntpService.h \
nsNewsFolder.h \
nsNntpIncomingServer.h \
nsNewsMessage.h \
nsNewsUtils.h \
nsNNTPHost.h \
nsNNTPCategoryContainer.h \
@ -59,7 +58,6 @@ CPP_OBJS= .\$(OBJDIR)\nsNNTPProtocol.obj \
.\$(OBJDIR)\nsNntpService.obj \
.\$(OBJDIR)\nsNewsFolder.obj \
.\$(OBJDIR)\nsNntpIncomingServer.obj \
.\$(OBJDIR)\nsNewsMessage.obj \
.\$(OBJDIR)\nsNewsUtils.obj \
$(NULL)

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

@ -44,7 +44,6 @@
#include "nsFileStream.h"
#include "nsMsgDBCID.h"
#include "nsMsgNewsCID.h"
#include "nsNewsMessage.h"
#include "nsMsgUtils.h"
#include "nsNewsUtils.h"
@ -986,6 +985,7 @@ NS_IMETHODIMP nsMsgNewsFolder::CreateMessageFromMsgDBHdr(nsIMsgDBHdr *msgDBHdr,
nsCOMPtr<nsIDBMessage> messageResource = do_QueryInterface(res);
if(messageResource) {
messageResource->SetMsgDBHdr(msgDBHdr);
messageResource->SetMessageType(nsIMessage::NewsMessage);
*message = messageResource;
NS_IF_ADDREF(*message);
}