diff --git a/mailnews/compose/public/nsIMsgSend.idl b/mailnews/compose/public/nsIMsgSend.idl index 5346c1e4894..4825a14e0e3 100644 --- a/mailnews/compose/public/nsIMsgSend.idl +++ b/mailnews/compose/public/nsIMsgSend.idl @@ -47,19 +47,7 @@ interface nsIMessage; interface nsIMsgHdr; interface nsIWebShell; -typedef PRInt32 nsMsgDeliverMode; - -%{ C++ -enum -{ - nsMsgDeliverNow = 0, - nsMsgQueueForLater = 1, - nsMsgSave = 2, - nsMsgSaveAs = 3, - nsMsgSaveAsDraft = 4, - nsMsgSaveAsTemplate = 5 -} /* nsMsgDeliverMode */; -%} +typedef long nsMsgDeliverMode; %{ C++ // @@ -141,7 +129,7 @@ typedef struct nsMsgAttachedFile } nsMsgAttachedFile; %} -[ptr] native sendListenerPtr(nsIMsgSendListener *); + [ptr] native nsMsgAttachmentData(nsMsgAttachmentData); [ptr] native nsMsgAttachedFile(nsMsgAttachedFile); @@ -157,43 +145,55 @@ interface nsIMsgSend : nsISupports // NOTE: when aEditor is non-null, a multipart related MHTML message will // be created // - [noscript] - void CreateAndSendMessage(in nsIEditorShell aEditor, - in nsIMsgIdentity aUserIdentity, - in nsIMsgCompFields fields, - in PRBool digest_p, - in PRBool dont_deliver_p, - in nsMsgDeliverMode mode, - in nsIMessage msgToReplace, - [const] in string attachment1_type, - [const] in string attachment1_body, - in PRUint32 attachment1_body_length, - [const] in nsMsgAttachmentData attachments, - [const] in nsMsgAttachedFile preloaded_attachments, - in voidStar relatedPart, - in sendListenerPtr aListenerArray); /* nsIMsgSendListener Array */ + + const nsMsgDeliverMode nsMsgDeliverNow = 0; - [noscript] - void SendMessageFile( - in nsIMsgIdentity aUserIdentity, - in nsIMsgCompFields fields, - in nsIFileSpec sendIFileSpec, - in PRBool deleteSendFileOnCompletion, - in PRBool digest_p, - in nsMsgDeliverMode mode, - in nsIMessage msgToReplace, - in sendListenerPtr aListenerArray); /* nsIMsgSendListener Array */ + const nsMsgDeliverMode nsMsgQueueForLater = 1; + const nsMsgDeliverMode nsMsgSave = 2; + const nsMsgDeliverMode nsMsgSaveAs = 3; + const nsMsgDeliverMode nsMsgSaveAsDraft = 4; + const nsMsgDeliverMode nsMsgSaveAsTemplate = 5; - [noscript] - void SendWebPage( - in nsIMsgIdentity aUserIdentity, - in nsIMsgCompFields fields, - in nsIURI url, - in nsMsgDeliverMode mode, - in sendListenerPtr aListenerArray); /* nsIMsgSendListener Array */ + [noscript] + void CreateAndSendMessage(in nsIEditorShell aEditor, + in nsIMsgIdentity aUserIdentity, + in nsIMsgCompFields fields, + in PRBool digest_p, + in PRBool dont_deliver_p, + in nsMsgDeliverMode mode, + in nsIMessage msgToReplace, + in string attachment1_type, + in string attachment1_body, + in PRUint32 attachment1_body_length, + [const] in nsMsgAttachmentData attachments, + [const] in nsMsgAttachedFile preloaded_attachments, + in voidStar relatedPart, + [array, size_is(listeners)] + in nsIMsgSendListener aListenerArray, + in unsigned long listeners); + + + void SendMessageFile(in nsIMsgIdentity aUserIdentity, + in nsIMsgCompFields fields, + in nsIFileSpec sendIFileSpec, + in PRBool deleteSendFileOnCompletion, + in PRBool digest_p, + in nsMsgDeliverMode mode, + in nsIMessage msgToReplace, + [array, size_is(listeners)] + in nsIMsgSendListener aListenerArray, + in unsigned long listeners); - void AddListener(in nsIMsgSendListener aListener); - void RemoveListener(in nsIMsgSendListener aListener); - void SetGUINotificationState(in PRBool aEnableFlag); - void SetWebShell(in nsIWebShell aWebShell); + void SendWebPage(in nsIMsgIdentity aUserIdentity, + in nsIMsgCompFields fields, + in nsIURI url, + in nsMsgDeliverMode mode, + [array, size_is(listeners)] + in nsIMsgSendListener aListenerArray, + in unsigned long listeners); + + void AddListener(in nsIMsgSendListener aListener); + void RemoveListener(in nsIMsgSendListener aListener); + void SetGUINotificationState(in PRBool aEnableFlag); + void SetWebShell(in nsIWebShell aWebShell); }; diff --git a/mailnews/compose/src/nsMsgCompUtils.cpp b/mailnews/compose/src/nsMsgCompUtils.cpp index 7d31c0a32fa..84c8ccbde07 100644 --- a/mailnews/compose/src/nsMsgCompUtils.cpp +++ b/mailnews/compose/src/nsMsgCompUtils.cpp @@ -220,9 +220,10 @@ mime_generate_headers (nsMsgCompFields *fields, int size = 0; char *buffer = 0, *buffer_tail = 0; - PRBool isDraft = deliver_mode == nsMsgSaveAsDraft || - deliver_mode == nsMsgSaveAsTemplate || - deliver_mode == nsMsgQueueForLater; + PRBool isDraft = + deliver_mode == nsIMsgSend::nsMsgSaveAsDraft || + deliver_mode == nsIMsgSend::nsMsgSaveAsTemplate || + deliver_mode == nsIMsgSend::nsMsgQueueForLater; const char* pFrom; const char* pTo; @@ -278,8 +279,8 @@ mime_generate_headers (nsMsgCompFields *fields, if (fields->GetReturnReceipt() && (fields->GetReturnReceiptType() == 2 || fields->GetReturnReceiptType() == 3) && - (deliver_mode != nsMsgSaveAsDraft && - deliver_mode != nsMsgSaveAsTemplate)) + (deliver_mode != nsIMsgSend::nsMsgSaveAsDraft && + deliver_mode != nsIMsgSend::nsMsgSaveAsTemplate)) { PRInt32 receipt_header_type = 0; @@ -545,7 +546,7 @@ mime_generate_headers (nsMsgCompFields *fields, // Send Later file, etc...). Because of that, we need to store what the user // typed in on the original composition window for use later when rebuilding // the headers - if (deliver_mode != nsMsgDeliverNow) + if (deliver_mode != nsIMsgSend::nsMsgDeliverNow) { // This is going to be saved for later, that means we should just store // what the user typed into the "Newsgroup" line in the HEADER_X_MOZILLA_NEWSHOST @@ -1869,7 +1870,7 @@ GetFolderURIFromUserPrefs(nsMsgDeliverMode aMode, if (!identity) return nsnull; - if (aMode == nsMsgQueueForLater) // QueueForLater (Outbox) + if (aMode == nsIMsgSend::nsMsgQueueForLater) // QueueForLater (Outbox) { NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv); if (NS_FAILED(rv) || !prefs) @@ -1881,11 +1882,11 @@ GetFolderURIFromUserPrefs(nsMsgDeliverMode aMode, rv = NS_OK; } } - else if (aMode == nsMsgSaveAsDraft) // SaveAsDraft (Drafts) + else if (aMode == nsIMsgSend::nsMsgSaveAsDraft) // SaveAsDraft (Drafts) { rv = identity->GetDraftFolder(&uri); } - else if (aMode == nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) + else if (aMode == nsIMsgSend::nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) { rv = identity->GetStationeryFolder(&uri); } diff --git a/mailnews/compose/src/nsMsgCompose.cpp b/mailnews/compose/src/nsMsgCompose.cpp index d8226cd8007..37b2b80dadd 100644 --- a/mailnews/compose/src/nsMsgCompose.cpp +++ b/mailnews/compose/src/nsMsgCompose.cpp @@ -564,7 +564,8 @@ nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, // set this object for use on completion... m_sendListener->SetComposeObj(this); m_sendListener->SetDeliverMode(deliverMode); - nsIMsgSendListener **tArray = m_sendListener->CreateListenerArray(); + PRUint32 listeners; + nsIMsgSendListener **tArray = m_sendListener->CreateListenerArray(&listeners); if (!tArray) { #ifdef DEBUG @@ -600,7 +601,7 @@ nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, nsnull, // const struct nsMsgAttachmentData *attachments, nsnull, // const struct nsMsgAttachedFile *preloaded_attachments, nsnull, // nsMsgSendPart *relatedPart, - tArray); // listener array + tArray, listeners); // listener array // Cleanup converted body... if (newBody) @@ -630,7 +631,8 @@ nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, // rhp: // We shouldn't close the window if we are just saving a draft or a template // so do this check - if ( (deliverMode != nsMsgSaveAsDraft) && (deliverMode != nsMsgSaveAsTemplate) ) + if ( (deliverMode != nsIMsgSend::nsMsgSaveAsDraft) && + (deliverMode != nsIMsgSend::nsMsgSaveAsTemplate) ) ShowWindow(PR_FALSE); } @@ -1608,38 +1610,21 @@ void nsMsgCompose::CleanUpRecipients(nsString& recipients) NS_IMPL_ADDREF(nsMsgComposeSendListener) NS_IMPL_RELEASE(nsMsgComposeSendListener) -nsIMsgSendListener ** nsMsgComposeSendListener::CreateListenerArray() +nsIMsgSendListener ** +nsMsgComposeSendListener::CreateListenerArray(PRUint32 *aListeners) { nsIMsgSendListener **tArray = (nsIMsgSendListener **)PR_Malloc(sizeof(nsIMsgSendListener *) * 2); if (!tArray) return nsnull; nsCRT::memset(tArray, 0, sizeof(nsIMsgSendListener *) * 2); tArray[0] = this; + *aListeners = 2; return tArray; } -NS_IMETHODIMP -nsMsgComposeSendListener::QueryInterface(const nsIID &aIID, void** aInstancePtr) -{ - if (NULL == aInstancePtr) - return NS_ERROR_NULL_POINTER; - *aInstancePtr = NULL; - - if (aIID.Equals(NS_GET_IID(nsIMsgSendListener))) - { - *aInstancePtr = (nsIMsgSendListener *) this; - NS_ADDREF_THIS(); - return NS_OK; - } - if (aIID.Equals(NS_GET_IID(nsIMsgCopyServiceListener))) - { - *aInstancePtr = (nsIMsgCopyServiceListener *) this; - NS_ADDREF_THIS(); - return NS_OK; - } - - return NS_NOINTERFACE; -} +NS_IMPL_QUERY_INTERFACE2(nsMsgComposeSendListener, + nsIMsgSendListener, + nsIMsgCopyServiceListener) nsMsgComposeSendListener::nsMsgComposeSendListener(void) { @@ -1772,7 +1757,8 @@ nsMsgComposeSendListener::OnStopCopy(nsresult aStatus) #endif // We should only close the window if we are done. Things like templates // and drafts aren't done so their windows should stay open - if ( (mDeliverMode != nsMsgSaveAsDraft) && (mDeliverMode != nsMsgSaveAsTemplate) ) + if ( (mDeliverMode != nsIMsgSend::nsMsgSaveAsDraft) && + (mDeliverMode != nsIMsgSend::nsMsgSaveAsTemplate) ) mComposeObj->CloseWindow(); } else diff --git a/mailnews/compose/src/nsMsgCompose.h b/mailnews/compose/src/nsMsgCompose.h index 2706e802272..01d92bd6a24 100644 --- a/mailnews/compose/src/nsMsgCompose.h +++ b/mailnews/compose/src/nsMsgCompose.h @@ -196,7 +196,7 @@ public: NS_IMETHOD SetComposeObj(nsMsgCompose *obj); NS_IMETHOD SetDeliverMode(MSG_DeliverMode deliverMode); - nsIMsgSendListener **CreateListenerArray(); + nsIMsgSendListener **CreateListenerArray(PRUint32 *aLength); private: diff --git a/mailnews/compose/src/nsMsgCopy.cpp b/mailnews/compose/src/nsMsgCopy.cpp index c48f9c153e6..6d14517b3d1 100644 --- a/mailnews/compose/src/nsMsgCopy.cpp +++ b/mailnews/compose/src/nsMsgCopy.cpp @@ -150,7 +150,7 @@ nsMsgCopy::nsMsgCopy() { mCopyListener = nsnull; mFileSpec = nsnull; - mMode = nsMsgDeliverNow; + mMode = nsIMsgSend::nsMsgDeliverNow; mSavePref = nsnull; NS_INIT_REFCNT(); @@ -183,7 +183,7 @@ nsMsgCopy::StartCopyOperation(nsIMsgIdentity *aUserIdentity, // // Vars for implementation... // - if (aMode == nsMsgQueueForLater) // QueueForLater (Outbox) + if (aMode == nsIMsgSend::nsMsgQueueForLater) // QueueForLater (Outbox) { rv = GetUnsentMessagesFolder(aUserIdentity, getter_AddRefs(dstFolder)); isDraft = PR_FALSE; @@ -191,7 +191,7 @@ nsMsgCopy::StartCopyOperation(nsIMsgIdentity *aUserIdentity, return NS_MSG_UNABLE_TO_SEND_LATER; } } - else if (aMode == nsMsgSaveAsDraft) // SaveAsDraft (Drafts) + else if (aMode == nsIMsgSend::nsMsgSaveAsDraft) // SaveAsDraft (Drafts) { rv = GetDraftsFolder(aUserIdentity, getter_AddRefs(dstFolder)); isDraft = PR_TRUE; @@ -199,7 +199,7 @@ nsMsgCopy::StartCopyOperation(nsIMsgIdentity *aUserIdentity, return NS_MSG_UNABLE_TO_SAVE_DRAFT; } } - else if (aMode == nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) + else if (aMode == nsIMsgSend::nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) { rv = GetTemplatesFolder(aUserIdentity, getter_AddRefs(dstFolder)); isDraft = PR_FALSE; @@ -256,25 +256,25 @@ nsMsgCopy::DoCopy(nsIFileSpec *aDiskFile, nsIMsgFolder *dstFolder, nsresult nsMsgCopy::GetUnsentMessagesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder) { - return LocateMessageFolder(userIdentity, nsMsgQueueForLater, mSavePref, folder); + return LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgQueueForLater, mSavePref, folder); } nsresult nsMsgCopy::GetDraftsFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder) { - return LocateMessageFolder(userIdentity, nsMsgSaveAsDraft, mSavePref, folder); + return LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgSaveAsDraft, mSavePref, folder); } nsresult nsMsgCopy::GetTemplatesFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder) { - return LocateMessageFolder(userIdentity, nsMsgSaveAsTemplate, mSavePref, folder); + return LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgSaveAsTemplate, mSavePref, folder); } nsresult nsMsgCopy::GetSentFolder(nsIMsgIdentity *userIdentity, nsIMsgFolder **folder) { - return LocateMessageFolder(userIdentity, nsMsgDeliverNow, mSavePref, folder); + return LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgDeliverNow, mSavePref, folder); } //////////////////////////////////////////////////////////////////////////////////// @@ -387,15 +387,15 @@ LocateMessageFolder(nsIMsgIdentity *userIdentity, PRUint32 numFolders = 0; // use the defaults by getting the folder by flags - if (aFolderType == nsMsgQueueForLater) // QueueForLater (Outbox) + if (aFolderType == nsIMsgSend::nsMsgQueueForLater) // QueueForLater (Outbox) { rv = rootFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_QUEUE, 1, &numFolders, msgFolder); } - else if (aFolderType == nsMsgSaveAsDraft) // SaveAsDraft (Drafts) + else if (aFolderType == nsIMsgSend::nsMsgSaveAsDraft) // SaveAsDraft (Drafts) { rv = rootFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_DRAFTS, 1, &numFolders, msgFolder); } - else if (aFolderType == nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) + else if (aFolderType == nsIMsgSend::nsMsgSaveAsTemplate) // SaveAsTemplate (Templates) { rv = rootFolder->GetFoldersWithFlag(MSG_FOLDER_FLAG_TEMPLATES, 1, &numFolders, msgFolder); } diff --git a/mailnews/compose/src/nsMsgSend.cpp b/mailnews/compose/src/nsMsgSend.cpp index 7e98e5e83f8..b5dcd39af11 100644 --- a/mailnews/compose/src/nsMsgSend.cpp +++ b/mailnews/compose/src/nsMsgSend.cpp @@ -3069,20 +3069,14 @@ nsMsgComposeAndSend::DoFcc() } nsresult -nsMsgComposeAndSend::SetListenerArray(nsIMsgSendListener **aListenerArray) +nsMsgComposeAndSend::SetListenerArray(nsIMsgSendListener **aListenerArray, + PRUint32 aListeners) { - nsIMsgSendListener **ptr = aListenerArray; - if ( (!aListenerArray) || (!*aListenerArray) ) return NS_OK; // First, count the listeners passed in... - mListenerArrayCount = 0; - while (*ptr != nsnull) - { - mListenerArrayCount++; - ++ptr; - } + mListenerArrayCount = aListeners; // now allocate an array to hold the number of entries. mListenerArray = (nsIMsgSendListener **) PR_Malloc(sizeof(nsIMsgSendListener *) * mListenerArrayCount); @@ -3400,11 +3394,12 @@ nsMsgComposeAndSend::CreateAndSendMessage( const nsMsgAttachmentData *attachments, const nsMsgAttachedFile *preloaded_attachments, void *relatedPart, - nsIMsgSendListener **aListenerArray) + nsIMsgSendListener **aListenerArray, + PRUint32 aListeners) { nsresult rv; - SetListenerArray(aListenerArray); + SetListenerArray(aListenerArray, aListeners); if (!attachment1_body || !*attachment1_body) { @@ -3437,7 +3432,8 @@ nsMsgComposeAndSend::SendMessageFile( PRBool digest_p, nsMsgDeliverMode mode, nsIMessage *msgToReplace, - nsIMsgSendListener **aListenerArray) + nsIMsgSendListener **aListenerArray, + PRUint32 aListeners) { nsresult rv; @@ -3468,7 +3464,7 @@ nsMsgComposeAndSend::SendMessageFile( return NS_ERROR_OUT_OF_MEMORY; // Setup the listeners... - SetListenerArray(aListenerArray); + SetListenerArray(aListenerArray, aListeners); // Should we delete the temp file when done? if (!deleteSendFileOnCompletion) @@ -3526,11 +3522,12 @@ BuildURLAttachmentData(nsIURI *url) } nsresult -nsMsgComposeAndSend::SendWebPage(nsIMsgIdentity *aUserIndentity, - nsIMsgCompFields *fields, - nsIURI *url, - nsMsgDeliverMode mode, - nsIMsgSendListener **aListenerArray) +nsMsgComposeAndSend::SendWebPage(nsIMsgIdentity *aUserIndentity, + nsIMsgCompFields *fields, + nsIURI *url, + nsMsgDeliverMode mode, + nsIMsgSendListener **aListenerArray, + PRUint32 aListeners) { nsresult rv; nsMsgAttachmentData *tmpPageData = nsnull; @@ -3544,7 +3541,7 @@ nsMsgComposeAndSend::SendWebPage(nsIMsgIdentity *aUserIndenti tmpPageData = BuildURLAttachmentData(url); // Setup the listeners... - SetListenerArray(aListenerArray); + SetListenerArray(aListenerArray, aListeners); /* string GetBody(); */ PRInt32 bodyLen; @@ -3571,7 +3568,7 @@ nsMsgComposeAndSend::SendWebPage(nsIMsgIdentity *aUserIndenti tmpPageData, // const nsMsgAttachmentData *attachments, nsnull, // const nsMsgAttachedFile *preloaded_attachments, nsnull, // void *relatedPart, - aListenerArray); + aListenerArray, aListeners); return rv; } diff --git a/mailnews/compose/src/nsMsgSend.h b/mailnews/compose/src/nsMsgSend.h index 2622bd550ad..7a51e1148a5 100644 --- a/mailnews/compose/src/nsMsgSend.h +++ b/mailnews/compose/src/nsMsgSend.h @@ -248,9 +248,7 @@ public: NS_IMETHOD GetBodyFromEditor(); // methods for listener array processing... - NS_IMETHOD SetListenerArray(nsIMsgSendListener **aListener); - NS_IMETHOD AddListener(nsIMsgSendListener *aListener); - NS_IMETHOD RemoveListener(nsIMsgSendListener *aListener); + NS_IMETHOD SetListenerArray(nsIMsgSendListener **aListener, PRUint32 aListenrs); NS_IMETHOD DeleteListeners(); NS_IMETHOD NotifyListenersOnStartSending(const char *aMsgID, PRUint32 aMsgSize); NS_IMETHOD NotifyListenersOnProgress(const char *aMsgID, PRUint32 aProgress, PRUint32 aProgressMax); @@ -266,9 +264,6 @@ public: NS_IMETHOD SetMessageKey(PRUint32 aMessageKey); NS_IMETHOD GetMessageId(nsCString* aMessageId); - // For GUI notification... - NS_IMETHOD SetGUINotificationState(PRBool aEnableFlag); - // // Attachment processing... // @@ -292,46 +287,7 @@ public: nsMsgSendPart *toppart); // The very top most container of the message // For part processing - //////////////////////////////////////////////////////////////////////////////// - // The current nsIMsgSend Interfaces exposed to the world! - //////////////////////////////////////////////////////////////////////////////// - NS_IMETHOD CreateAndSendMessage( - nsIEditorShell *aEditor, - nsIMsgIdentity *aUserIdentity, - nsIMsgCompFields *fields, - PRBool digest_p, - PRBool dont_deliver_p, - nsMsgDeliverMode mode, - nsIMessage *msgToReplace, - const char *attachment1_type, - const char *attachment1_body, - PRUint32 attachment1_body_length, - const nsMsgAttachmentData *attachments, - const nsMsgAttachedFile *preloaded_attachments, - void *relatedPart, - // This is an array of nsIMsgSendListener objects...there must - // be N+1 entries in the array with the final entry set to nsnull - nsIMsgSendListener **aListenerArray); - - NS_IMETHOD SendMessageFile( - nsIMsgIdentity *aUserIdentity, - nsIMsgCompFields *fields, - nsIFileSpec *sendIFileSpec, - PRBool deleteSendFileOnCompletion, - PRBool digest_p, - nsMsgDeliverMode mode, - nsIMessage *msgToReplace, - nsIMsgSendListener **aListenerArray); - - NS_IMETHOD SendWebPage( - nsIMsgIdentity *aUserIdentity, - nsIMsgCompFields *fields, - nsIURI *url, - nsMsgDeliverMode mode, - nsIMsgSendListener **aListenerArray); - - NS_IMETHOD SetWebShell (nsIWebShell *aWebShell); - + NS_DECL_NSIMSGSEND nsresult SetStatusMessage(const PRUnichar *aMsgString); // Status message method // diff --git a/mailnews/compose/src/nsMsgSendLater.cpp b/mailnews/compose/src/nsMsgSendLater.cpp index 33453c80173..128c17e503a 100644 --- a/mailnews/compose/src/nsMsgSendLater.cpp +++ b/mailnews/compose/src/nsMsgSendLater.cpp @@ -417,7 +417,7 @@ SendOperationListener::OnStopSending(const char *aMsgID, nsresult aStatus, const } nsIMsgSendListener ** -CreateListenerArray(nsIMsgSendListener *listener) +CreateListenerArray(nsIMsgSendListener *listener, PRUint32 *aListeners) { if (!listener) return nsnull; @@ -427,6 +427,7 @@ CreateListenerArray(nsIMsgSendListener *listener) return nsnull; nsCRT::memset(tArray, 0, sizeof(nsIMsgSendListener *) * 2); tArray[0] = listener; + *aListeners = 2; return tArray; } @@ -509,7 +510,8 @@ nsCOMPtr pMsgSend = nsnull; NS_ADDREF(mSendListener); // set this object for use on completion... mSendListener->SetSendLaterObject(this); - nsIMsgSendListener **tArray = CreateListenerArray(mSendListener); + PRUint32 listeners; + nsIMsgSendListener **tArray = CreateListenerArray(mSendListener, &listeners); if (!tArray) { NS_RELEASE(mSendListener); @@ -519,13 +521,13 @@ nsCOMPtr pMsgSend = nsnull; NS_ADDREF(this); rv = pMsgSend->SendMessageFile(mIdentity, - compFields, // nsIMsgCompFields *fields, - mTempIFileSpec, // nsIFileSpec *sendFileSpec, - PR_TRUE, // PRBool deleteSendFileOnCompletion, - PR_FALSE, // PRBool digest_p, - nsMsgDeliverNow, // nsMsgDeliverMode mode, - nsnull, // nsIMessage *msgToReplace, - tArray); + compFields, // nsIMsgCompFields *fields, + mTempIFileSpec, // nsIFileSpec *sendFileSpec, + PR_TRUE, // PRBool deleteSendFileOnCompletion, + PR_FALSE, // PRBool digest_p, + nsIMsgSend::nsMsgDeliverNow, // nsMsgDeliverMode mode, + nsnull, // nsIMessage *msgToReplace, + tArray, listeners); NS_RELEASE(mSendListener); mSendListener = nsnull; if (NS_FAILED(rv)) @@ -648,7 +650,7 @@ nsMsgSendLater::GetUnsentMessagesFolder(nsIMsgIdentity *userIdentity, nsIMsgFold if (!uri) return NS_ERROR_FAILURE; - rv = LocateMessageFolder(userIdentity, nsMsgQueueForLater, uri, folder); + rv = LocateMessageFolder(userIdentity, nsIMsgSend::nsMsgQueueForLater, uri, folder); PR_FREEIF(uri); return rv; } diff --git a/mailnews/import/eudora/src/nsEudoraCompose.cpp b/mailnews/import/eudora/src/nsEudoraCompose.cpp index 2ba66560cd9..afb15b25c28 100644 --- a/mailnews/import/eudora/src/nsEudoraCompose.cpp +++ b/mailnews/import/eudora/src/nsEudoraCompose.cpp @@ -605,7 +605,7 @@ nsresult nsEudoraCompose::SendTheMessage( nsIFileSpec *pMsg) m_pMsgFields, // message fields PR_FALSE, // digest = NO PR_TRUE, // dont_deliver = YES, make a file - nsMsgDeliverNow, // mode + nsIMsgSend::nsMsgDeliverNow, // mode nsnull, // no message to replace pMimeType, // body type m_pBody, // body pointer @@ -613,7 +613,7 @@ nsresult nsEudoraCompose::SendTheMessage( nsIFileSpec *pMsg) nsnull, // remote attachment data pAttach, // local attachments nsnull, // related part - nsnull); // listener array + nsnull, 0); // listener array // IMPORT_LOG0( "Returned from CreateAndSendMessage\n"); diff --git a/mailnews/import/outlook/src/nsOutlookCompose.cpp b/mailnews/import/outlook/src/nsOutlookCompose.cpp index 276e336f7c5..de9e27740fb 100644 --- a/mailnews/import/outlook/src/nsOutlookCompose.cpp +++ b/mailnews/import/outlook/src/nsOutlookCompose.cpp @@ -606,7 +606,7 @@ nsresult nsOutlookCompose::SendTheMessage( nsIFileSpec *pMsg) m_pMsgFields, // message fields PR_FALSE, // digest = NO PR_TRUE, // dont_deliver = YES, make a file - nsMsgDeliverNow, // mode + nsIMsgSend::nsMsgDeliverNow, // mode nsnull, // no message to replace pMimeType, // body type m_pBody, // body pointer @@ -614,7 +614,7 @@ nsresult nsOutlookCompose::SendTheMessage( nsIFileSpec *pMsg) nsnull, // remote attachment data pAttach, // local attachments nsnull, // related part - nsnull); // listener array + nsnull, 0); // listener array // IMPORT_LOG0( "Returned from CreateAndSendMessage\n");