From ebc5b3c4b7bf708c06147b26faff3d0f46b7e9fd Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Wed, 16 Aug 2000 23:45:58 +0000 Subject: [PATCH] rework nsMessages so they are generic across all server/folder types, so that we can recycle them later r=putterman for bug #26456 --- mailnews/base/build/makefile.win | 1 + mailnews/base/build/nsMsgBaseCID.h | 31 +++++++---- mailnews/base/build/nsMsgFactory.cpp | 14 +++++ mailnews/base/public/nsIMessage.idl | 2 +- mailnews/base/util/nsMessage.cpp | 10 +++- mailnews/base/util/nsMessage.h | 3 ++ mailnews/imap/src/makefile.win | 2 - mailnews/imap/src/nsIMAPHostSessionList.cpp | 3 +- mailnews/imap/src/nsImapMailFolder.cpp | 57 ++++++++++----------- mailnews/local/build/nsMsgLocalCID.h | 10 ---- mailnews/local/build/nsMsgLocalFactory.cpp | 13 ----- mailnews/local/src/MANIFEST | 1 - mailnews/local/src/makefile.win | 2 - mailnews/local/src/nsLocalMailFolder.cpp | 4 +- mailnews/news/build/makefile.win | 2 +- mailnews/news/build/nsMsgNewsCID.h | 11 ---- mailnews/news/build/nsMsgNewsFactory.cpp | 6 --- mailnews/news/src/makefile.win | 2 - mailnews/news/src/nsNewsFolder.cpp | 2 +- 19 files changed, 83 insertions(+), 93 deletions(-) diff --git a/mailnews/base/build/makefile.win b/mailnews/base/build/makefile.win index ef79f6ab2039..d6f3b9795633 100644 --- a/mailnews/base/build/makefile.win +++ b/mailnews/base/build/makefile.win @@ -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) diff --git a/mailnews/base/build/nsMsgBaseCID.h b/mailnews/base/build/nsMsgBaseCID.h index a7dabe7b1015..688e6341a300 100644 --- a/mailnews/base/build/nsMsgBaseCID.h +++ b/mailnews/base/build/nsMsgBaseCID.h @@ -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 // diff --git a/mailnews/base/build/nsMsgFactory.cpp b/mailnews/base/build/nsMsgFactory.cpp index cbce58e04881..f06641c8a80d 100644 --- a/mailnews/base/build/nsMsgFactory.cpp +++ b/mailnews/base/build/nsMsgFactory.cpp @@ -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, diff --git a/mailnews/base/public/nsIMessage.idl b/mailnews/base/public/nsIMessage.idl index 05204e08c282..76f0ef8f94a9 100644 --- a/mailnews/base/public/nsIMessage.idl +++ b/mailnews/base/public/nsIMessage.idl @@ -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; }; diff --git a/mailnews/base/util/nsMessage.cpp b/mailnews/base/util/nsMessage.cpp index 2a4474a046de..c36f797ab753 100644 --- a/mailnews/base/util/nsMessage.cpp +++ b/mailnews/base/util/nsMessage.cpp @@ -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; +} diff --git a/mailnews/base/util/nsMessage.h b/mailnews/base/util/nsMessage.h index 74accb761023..a0b993284477 100644 --- a/mailnews/base/util/nsMessage.h +++ b/mailnews/base/util/nsMessage.h @@ -55,7 +55,10 @@ protected: private: nsWeakPtr mFolder; nsMsgKey mMsgKey; + + // could be combined into bitfield PRBool mMsgKeyValid; + PRUint32 mMessageType; }; #endif //nsMessage_h__ diff --git a/mailnews/imap/src/makefile.win b/mailnews/imap/src/makefile.win index a90a2167b115..8fc968327b81 100644 --- a/mailnews/imap/src/makefile.win +++ b/mailnews/imap/src/makefile.win @@ -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 \ diff --git a/mailnews/imap/src/nsIMAPHostSessionList.cpp b/mailnews/imap/src/nsIMAPHostSessionList.cpp index e3aa4a634e80..d696eb22644e 100644 --- a/mailnews/imap/src/nsIMAPHostSessionList.cpp +++ b/mailnews/imap/src/nsIMAPHostSessionList.cpp @@ -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 diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 8852392aa659..795cde7f56d3 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -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 aEnumerator; nsCOMPtr 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 urlListener; @@ -3941,7 +3940,7 @@ nsImapMailFolder::CopyMessages(nsIMsgFolder* srcFolder, nsIMsgCopyServiceListener* listener) { nsresult rv = NS_OK; - nsCString messageIds; + nsCAutoString messageIds; nsMsgKeyArray srcKeyArray; nsCOMPtr urlListener; nsCOMPtr 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 urlListener; nsCOMPtr srcSupport; nsCOMPtr messages; diff --git a/mailnews/local/build/nsMsgLocalCID.h b/mailnews/local/build/nsMsgLocalCID.h index 656556520505..82161ef3fba9 100644 --- a/mailnews/local/build/nsMsgLocalCID.h +++ b/mailnews/local/build/nsMsgLocalCID.h @@ -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 diff --git a/mailnews/local/build/nsMsgLocalFactory.cpp b/mailnews/local/build/nsMsgLocalFactory.cpp index eebaf96e9660..ebb36d31bd44 100644 --- a/mailnews/local/build/nsMsgLocalFactory.cpp +++ b/mailnews/local/build/nsMsgLocalFactory.cpp @@ -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 mPop3ServiceFactory; nsCOMPtr mNoneServiceFactory; nsCOMPtr mLocalMailFolderFactory; - nsCOMPtr mLocalMessageFactory; nsCOMPtr mParseMailMsgStateFactory; nsCOMPtr mPop3IncomingServerFactory; nsCOMPtr 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, diff --git a/mailnews/local/src/MANIFEST b/mailnews/local/src/MANIFEST index 22b02db07af1..a2487c68f256 100644 --- a/mailnews/local/src/MANIFEST +++ b/mailnews/local/src/MANIFEST @@ -29,7 +29,6 @@ nsMailboxProtocol.h nsMailboxService.h nsPop3Service.h nsPop3IncomingServer.h -nsLocalMessage.h nsLocalStringBundle.h nsNoneService.h nsNoIncomingServer.h diff --git a/mailnews/local/src/makefile.win b/mailnews/local/src/makefile.win index c3f4b9b3c7c6..56088bd59c8a 100644 --- a/mailnews/local/src/makefile.win +++ b/mailnews/local/src/makefile.win @@ -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 \ diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index f90e1e55cb04..a5a2499dac89 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -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); } diff --git a/mailnews/news/build/makefile.win b/mailnews/news/build/makefile.win index a4141cc9a06c..0815b4e83f12 100644 --- a/mailnews/news/build/makefile.win +++ b/mailnews/news/build/makefile.win @@ -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) diff --git a/mailnews/news/build/nsMsgNewsCID.h b/mailnews/news/build/nsMsgNewsCID.h index 4880ada0eb5f..2e4fe8992082 100644 --- a/mailnews/news/build/nsMsgNewsCID.h +++ b/mailnews/news/build/nsMsgNewsCID.h @@ -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 // diff --git a/mailnews/news/build/nsMsgNewsFactory.cpp b/mailnews/news/build/nsMsgNewsFactory.cpp index bafec8bee59f..4da93b9bee39 100644 --- a/mailnews/news/build/nsMsgNewsFactory.cpp +++ b/mailnews/news/build/nsMsgNewsFactory.cpp @@ -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, diff --git a/mailnews/news/src/makefile.win b/mailnews/news/src/makefile.win index 7964f246d1b2..a194f253ad19 100644 --- a/mailnews/news/src/makefile.win +++ b/mailnews/news/src/makefile.win @@ -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) diff --git a/mailnews/news/src/nsNewsFolder.cpp b/mailnews/news/src/nsNewsFolder.cpp index 7fead0392592..ecb4b7b2496b 100644 --- a/mailnews/news/src/nsNewsFolder.cpp +++ b/mailnews/news/src/nsNewsFolder.cpp @@ -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 messageResource = do_QueryInterface(res); if(messageResource) { messageResource->SetMsgDBHdr(msgDBHdr); + messageResource->SetMessageType(nsIMessage::NewsMessage); *message = messageResource; NS_IF_ADDREF(*message); }