зеркало из https://github.com/mozilla/pjs.git
Fix for bug 95124. Add/update interfaces to pass a send listener and a smtp password when opening a compose window. R=bienvenu, SR=mscott
This commit is contained in:
Родитель
15bd513e75
Коммит
cb00fbf56f
|
@ -185,10 +185,10 @@ interface nsIMsgCompose : nsISupports {
|
||||||
of the body to 0 (clean).
|
of the body to 0 (clean).
|
||||||
*/
|
*/
|
||||||
attribute boolean bodyModified;
|
attribute boolean bodyModified;
|
||||||
|
|
||||||
|
|
||||||
/* The following functions are for internal use, essentially for the listener */
|
/* The following functions are for internal use, essentially for the listener */
|
||||||
|
|
||||||
/* ... */
|
/* ... */
|
||||||
[noscript] void setCiteReference(in nsString citeReference);
|
[noscript] void setCiteReference(in nsString citeReference);
|
||||||
|
|
||||||
|
@ -201,18 +201,21 @@ interface nsIMsgCompose : nsISupports {
|
||||||
/* set any reply flags on the original message's folder */
|
/* set any reply flags on the original message's folder */
|
||||||
[noscript] void processReplyFlags();
|
[noscript] void processReplyFlags();
|
||||||
|
|
||||||
/* ... */
|
/* ... */
|
||||||
[noscript] void convertAndLoadComposeWindow(in nsIEditorShell aEditorShell, in nsStringRef aPrefix, in nsStringRef aBuf,
|
[noscript] void convertAndLoadComposeWindow(in nsIEditorShell aEditorShell, in nsStringRef aPrefix, in nsStringRef aBuf,
|
||||||
in nsStringRef aSignature, in boolean aQuoted, in boolean aHTMLEditor);
|
in nsStringRef aSignature, in boolean aQuoted, in boolean aHTMLEditor);
|
||||||
|
|
||||||
/* Tell the doc state listeners that the doc state has changed */
|
/* Tell the doc state listeners that the doc state has changed */
|
||||||
[noscript] void notifyStateListeners(in TStateListenerNotification aNotificationType, in nsresult aResult);
|
[noscript] void notifyStateListeners(in TStateListenerNotification aNotificationType, in nsresult aResult);
|
||||||
|
|
||||||
/* Retreive the progress object */
|
/* Retreive the progress object */
|
||||||
[noscript] nsIMsgProgress getProgress();
|
[noscript] nsIMsgProgress getProgress();
|
||||||
|
|
||||||
/* Retreive the message send object */
|
/* Retreive the message send object */
|
||||||
[noscript] nsIMsgSend getMessageSend();
|
[noscript] nsIMsgSend getMessageSend();
|
||||||
|
|
||||||
|
/* Retreive the external send listener */
|
||||||
|
nsIMsgSendListener getExternalSendListener();
|
||||||
|
|
||||||
/* ... */
|
/* ... */
|
||||||
[noscript] void buildBodyMessageAndSignature();
|
[noscript] void buildBodyMessageAndSignature();
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
#include "nsIMsgIdentity.idl"
|
#include "nsIMsgIdentity.idl"
|
||||||
#include "nsIMsgCompFields.idl"
|
#include "nsIMsgCompFields.idl"
|
||||||
|
#include "nsIMsgSendListener.idl"
|
||||||
|
|
||||||
typedef long MSG_ComposeType;
|
typedef long MSG_ComposeType;
|
||||||
|
|
||||||
|
@ -65,4 +66,7 @@ interface nsIMsgComposeParams : nsISupports {
|
||||||
|
|
||||||
attribute nsIMsgCompFields composeFields;
|
attribute nsIMsgCompFields composeFields;
|
||||||
attribute boolean bodyIsLink;
|
attribute boolean bodyIsLink;
|
||||||
|
|
||||||
|
attribute nsIMsgSendListener sendListener;
|
||||||
|
attribute string smtpPassword;
|
||||||
};
|
};
|
||||||
|
|
|
@ -53,6 +53,9 @@ interface nsIMsgComposeService : nsISupports {
|
||||||
void OpenComposeWindowWithCompFields(in string msgComposeWindowURL, in MSG_ComposeType type, in MSG_ComposeFormat format,
|
void OpenComposeWindowWithCompFields(in string msgComposeWindowURL, in MSG_ComposeType type, in MSG_ComposeFormat format,
|
||||||
in nsIMsgCompFields compFields, in nsIMsgIdentity identity);
|
in nsIMsgCompFields compFields, in nsIMsgIdentity identity);
|
||||||
|
|
||||||
|
/* ... */
|
||||||
|
void OpenComposeWindowWithParams(in string msgComposeWindowURL, in nsIMsgComposeParams params);
|
||||||
|
|
||||||
/* ... */
|
/* ... */
|
||||||
nsIMsgCompose InitCompose(in nsIDOMWindowInternal aWindow, in nsIMsgComposeParams params);
|
nsIMsgCompose InitCompose(in nsIDOMWindowInternal aWindow, in nsIMsgComposeParams params);
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,8 @@ interface nsIMsgSend : nsISupports
|
||||||
in voidPtr relatedPart,
|
in voidPtr relatedPart,
|
||||||
in nsIDOMWindowInternal parentWindow,
|
in nsIDOMWindowInternal parentWindow,
|
||||||
in nsIMsgProgress progress,
|
in nsIMsgProgress progress,
|
||||||
in nsIMsgSendListener aListener
|
in nsIMsgSendListener aListener,
|
||||||
|
in string password
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
@ -194,8 +195,9 @@ interface nsIMsgSend : nsISupports
|
||||||
in PRBool digest_p,
|
in PRBool digest_p,
|
||||||
in nsMsgDeliverMode mode,
|
in nsMsgDeliverMode mode,
|
||||||
in nsIMsgDBHdr msgToReplace,
|
in nsIMsgDBHdr msgToReplace,
|
||||||
in nsIMsgSendListener aListener
|
in nsIMsgSendListener aListener,
|
||||||
);
|
in string password
|
||||||
|
);
|
||||||
|
|
||||||
/* Abort current send/save operation */
|
/* Abort current send/save operation */
|
||||||
void abort();
|
void abort();
|
||||||
|
|
|
@ -48,19 +48,21 @@ interface nsISmtpService : nsISupports {
|
||||||
// If you don't care about listening to the url, feel free to pass in
|
// If you don't care about listening to the url, feel free to pass in
|
||||||
// nsnull for that argument.
|
// nsnull for that argument.
|
||||||
//
|
//
|
||||||
// You can also pass an SMTP server as an argument if you want to send
|
// You can also pass an password as an argument if you want to prevent
|
||||||
// this message with a specific server.. otherwise it will use the
|
// a dialog to popup if the password is needed for a secure transmission
|
||||||
// default server
|
//
|
||||||
|
// The server associate to the Sender Identity will be used or the default
|
||||||
|
// server.
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void SendMailMessage(in nsIFileSpec aFilePath, in string aRecipients,
|
void SendMailMessage(in nsIFileSpec aFilePath, in string aRecipients,
|
||||||
in nsIMsgIdentity aSenderIdentity,
|
in nsIMsgIdentity aSenderIdentity,
|
||||||
|
in string aPassword,
|
||||||
in nsIUrlListener aUrlListener,
|
in nsIUrlListener aUrlListener,
|
||||||
in nsISmtpServer aServer,
|
in nsIMsgStatusFeedback aStatusListener,
|
||||||
in nsIMsgStatusFeedback aStatusListener,
|
|
||||||
in nsIInterfaceRequestor aNotificationCallbacks,
|
in nsIInterfaceRequestor aNotificationCallbacks,
|
||||||
out nsIURI aURL,
|
out nsIURI aURL,
|
||||||
out nsIRequest aRequest);
|
out nsIRequest aRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A copy of the array of SMTP servers, as stored in the preferences
|
* A copy of the array of SMTP servers, as stored in the preferences
|
||||||
|
|
|
@ -650,6 +650,11 @@ nsresult nsMsgCompose::Initialize(nsIDOMWindowInternal *aWindow,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
params->GetSendListener(getter_AddRefs(mExternalSendListener));
|
||||||
|
nsXPIDLCString smtpPassword;
|
||||||
|
params->GetSmtpPassword(getter_Copies(smtpPassword));
|
||||||
|
mSmtpPassword = (const char *)smtpPassword;
|
||||||
|
|
||||||
return CreateMessage(originalMsgURI, type, format, composeFields);
|
return CreateMessage(originalMsgURI, type, format, composeFields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -806,7 +811,8 @@ nsresult nsMsgCompose::_SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *ide
|
||||||
nsnull, // nsMsgSendPart *relatedPart,
|
nsnull, // nsMsgSendPart *relatedPart,
|
||||||
m_window, // nsIDOMWindowInternal *parentWindow;
|
m_window, // nsIDOMWindowInternal *parentWindow;
|
||||||
mProgress, // nsIMsgProgress *progress,
|
mProgress, // nsIMsgProgress *progress,
|
||||||
sendListener); // listener
|
sendListener, // listener
|
||||||
|
mSmtpPassword.get());
|
||||||
|
|
||||||
// Cleanup converted body...
|
// Cleanup converted body...
|
||||||
if (newBody)
|
if (newBody)
|
||||||
|
@ -1286,7 +1292,7 @@ nsresult nsMsgCompose::CreateMessage(const char * originalMsgURI,
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgCompose::GetProgress(nsIMsgProgress **_retval)
|
NS_IMETHODIMP nsMsgCompose::GetProgress(nsIMsgProgress **_retval)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG(_retval);
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
*_retval = mProgress;
|
*_retval = mProgress;
|
||||||
NS_IF_ADDREF(*_retval);
|
NS_IF_ADDREF(*_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -1294,12 +1300,20 @@ NS_IMETHODIMP nsMsgCompose::GetProgress(nsIMsgProgress **_retval)
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgCompose::GetMessageSend(nsIMsgSend **_retval)
|
NS_IMETHODIMP nsMsgCompose::GetMessageSend(nsIMsgSend **_retval)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG(_retval);
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
*_retval = mMsgSend;
|
*_retval = mMsgSend;
|
||||||
NS_IF_ADDREF(*_retval);
|
NS_IF_ADDREF(*_retval);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP nsMsgCompose::GetExternalSendListener(nsIMsgSendListener **_retval)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
|
*_retval = mExternalSendListener;
|
||||||
|
NS_IF_ADDREF(*_retval);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsMsgCompose::SetCiteReference(nsString citeReference)
|
NS_IMETHODIMP nsMsgCompose::SetCiteReference(nsString citeReference)
|
||||||
{
|
{
|
||||||
mCiteReference = citeReference;
|
mCiteReference = citeReference;
|
||||||
|
@ -1959,6 +1973,16 @@ nsMsgComposeSendListener::OnStartSending(const char *aMsgID, PRUint32 aMsgSize)
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
printf("nsMsgComposeSendListener::OnStartSending()\n");
|
printf("nsMsgComposeSendListener::OnStartSending()\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
|
||||||
|
if (compose)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIMsgSendListener> externalListener;
|
||||||
|
compose->GetExternalSendListener(getter_AddRefs(externalListener));
|
||||||
|
if (externalListener)
|
||||||
|
externalListener->OnStartSending(aMsgID, aMsgSize);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1968,6 +1992,16 @@ nsMsgComposeSendListener::OnProgress(const char *aMsgID, PRUint32 aProgress, PRU
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
printf("nsMsgComposeSendListener::OnProgress()\n");
|
printf("nsMsgComposeSendListener::OnProgress()\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
|
||||||
|
if (compose)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIMsgSendListener> externalListener;
|
||||||
|
compose->GetExternalSendListener(getter_AddRefs(externalListener));
|
||||||
|
if (externalListener)
|
||||||
|
externalListener->OnProgress(aMsgID, aProgress, aProgressMax);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1978,6 +2012,15 @@ nsMsgComposeSendListener::OnStatus(const char *aMsgID, const PRUnichar *aMsg)
|
||||||
printf("nsMsgComposeSendListener::OnStatus()\n");
|
printf("nsMsgComposeSendListener::OnStatus()\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
|
||||||
|
if (compose)
|
||||||
|
{
|
||||||
|
nsCOMPtr<nsIMsgSendListener> externalListener;
|
||||||
|
compose->GetExternalSendListener(getter_AddRefs(externalListener));
|
||||||
|
if (externalListener)
|
||||||
|
externalListener->OnStatus(aMsgID, aMsg);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2047,7 +2090,12 @@ nsresult nsMsgComposeSendListener::OnStopSending(const char *aMsgID, nsresult aS
|
||||||
if (progress)
|
if (progress)
|
||||||
progress->CloseProgressDialog(PR_TRUE);
|
progress->CloseProgressDialog(PR_TRUE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
nsCOMPtr<nsIMsgSendListener> externalListener;
|
||||||
|
compose->GetExternalSendListener(getter_AddRefs(externalListener));
|
||||||
|
if (externalListener)
|
||||||
|
externalListener->OnStopSending(aMsgID, aStatus, aMsg, returnFileSpec);
|
||||||
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -2057,8 +2105,15 @@ nsMsgComposeSendListener::OnGetDraftFolderURI(const char *aFolderURI)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
|
nsCOMPtr<nsIMsgCompose>compose = do_QueryReferent(mWeakComposeObj);
|
||||||
if (compose)
|
if (compose)
|
||||||
|
{
|
||||||
compose->SetSavedFolderURI(aFolderURI);
|
compose->SetSavedFolderURI(aFolderURI);
|
||||||
|
|
||||||
|
nsCOMPtr<nsIMsgSendListener> externalListener;
|
||||||
|
compose->GetExternalSendListener(getter_AddRefs(externalListener));
|
||||||
|
if (externalListener)
|
||||||
|
externalListener->OnGetDraftFolderURI(aFolderURI);
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,6 +126,9 @@ private:
|
||||||
nsMsgDocumentStateListener *mDocumentListener;
|
nsMsgDocumentStateListener *mDocumentListener;
|
||||||
MSG_ComposeType mType; //Message type
|
MSG_ComposeType mType; //Message type
|
||||||
nsCOMPtr<nsISupportsArray> mStateListeners; // contents are nsISupports
|
nsCOMPtr<nsISupportsArray> mStateListeners; // contents are nsISupports
|
||||||
|
|
||||||
|
nsCOMPtr<nsIMsgSendListener> mExternalSendListener;
|
||||||
|
nsCString mSmtpPassword;
|
||||||
|
|
||||||
friend class QuotingOutputStreamListener;
|
friend class QuotingOutputStreamListener;
|
||||||
friend class nsMsgDocumentStateListener;
|
friend class nsMsgDocumentStateListener;
|
||||||
|
|
|
@ -66,7 +66,7 @@ NS_IMETHODIMP nsMsgComposeParams::SetFormat(MSG_ComposeFormat aFormat)
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* attribute wstring originalMsgURI; */
|
/* attribute string originalMsgURI; */
|
||||||
NS_IMETHODIMP nsMsgComposeParams::GetOriginalMsgURI(char * *aOriginalMsgURI)
|
NS_IMETHODIMP nsMsgComposeParams::GetOriginalMsgURI(char * *aOriginalMsgURI)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(aOriginalMsgURI);
|
NS_ENSURE_ARG_POINTER(aOriginalMsgURI);
|
||||||
|
@ -133,3 +133,38 @@ NS_IMETHODIMP nsMsgComposeParams::SetBodyIsLink(PRBool aBodyIsLink)
|
||||||
mBodyIsLink = aBodyIsLink;
|
mBodyIsLink = aBodyIsLink;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* attribute nsIMsgSendLisneter sendListener; */
|
||||||
|
NS_IMETHODIMP nsMsgComposeParams::GetSendListener(nsIMsgSendListener * *aSendListener)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(aSendListener);
|
||||||
|
|
||||||
|
if (mSendListener)
|
||||||
|
{
|
||||||
|
*aSendListener = mSendListener;
|
||||||
|
NS_ADDREF(*aSendListener);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*aSendListener = nsnull;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
NS_IMETHODIMP nsMsgComposeParams::SetSendListener(nsIMsgSendListener * aSendListener)
|
||||||
|
{
|
||||||
|
mSendListener = aSendListener;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* attribute string smtpPassword; */
|
||||||
|
NS_IMETHODIMP nsMsgComposeParams::GetSmtpPassword(char * *aSmtpPassword)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(aSmtpPassword);
|
||||||
|
|
||||||
|
*aSmtpPassword = mSMTPPassword.ToNewCString();
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
NS_IMETHODIMP nsMsgComposeParams::SetSmtpPassword(const char * aSmtpPassword)
|
||||||
|
{
|
||||||
|
mSMTPPassword = aSmtpPassword;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,4 +39,6 @@ public:
|
||||||
nsCOMPtr<nsIMsgIdentity> mIdentity;
|
nsCOMPtr<nsIMsgIdentity> mIdentity;
|
||||||
nsCOMPtr<nsIMsgCompFields> mComposeFields;
|
nsCOMPtr<nsIMsgCompFields> mComposeFields;
|
||||||
PRBool mBodyIsLink;
|
PRBool mBodyIsLink;
|
||||||
|
nsCOMPtr<nsIMsgSendListener> mSendListener;
|
||||||
|
nsCString mSMTPPassword;
|
||||||
};
|
};
|
||||||
|
|
|
@ -311,6 +311,17 @@ nsresult nsMsgComposeService::OpenComposeWindowWithCompFields(const char *msgCom
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult nsMsgComposeService::OpenComposeWindowWithParams(const char *msgComposeWindowURL,
|
||||||
|
nsIMsgComposeParams *params)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(params);
|
||||||
|
|
||||||
|
#ifdef MSGCOMP_TRACE_PERFORMANCE
|
||||||
|
TimeStamp("Start opening the window", PR_TRUE);
|
||||||
|
#endif
|
||||||
|
return openWindow(msgComposeWindowURL, params);
|
||||||
|
}
|
||||||
|
|
||||||
nsresult nsMsgComposeService::InitCompose(nsIDOMWindowInternal *aWindow,
|
nsresult nsMsgComposeService::InitCompose(nsIDOMWindowInternal *aWindow,
|
||||||
nsIMsgComposeParams *params,
|
nsIMsgComposeParams *params,
|
||||||
nsIMsgCompose **_retval)
|
nsIMsgCompose **_retval)
|
||||||
|
|
|
@ -2667,7 +2667,8 @@ nsMsgComposeAndSend::Init(
|
||||||
const char *attachment1_body,
|
const char *attachment1_body,
|
||||||
PRUint32 attachment1_body_length,
|
PRUint32 attachment1_body_length,
|
||||||
const nsMsgAttachmentData *attachments,
|
const nsMsgAttachmentData *attachments,
|
||||||
const nsMsgAttachedFile *preloaded_attachments)
|
const nsMsgAttachedFile *preloaded_attachments,
|
||||||
|
const char *password)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
|
@ -2760,6 +2761,8 @@ nsMsgComposeAndSend::Init(
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSmtpPassword = password;
|
||||||
|
|
||||||
return HackAttachments(attachments, preloaded_attachments);
|
return HackAttachments(attachments, preloaded_attachments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3027,7 +3030,7 @@ nsMsgComposeAndSend::DeliverFileAsMail()
|
||||||
nsCOMPtr<nsIMsgStatusFeedback> msgStatus (do_QueryInterface(mSendProgress));
|
nsCOMPtr<nsIMsgStatusFeedback> msgStatus (do_QueryInterface(mSendProgress));
|
||||||
|
|
||||||
rv = smtpService->SendMailMessage(aFileSpec, buf, mUserIdentity,
|
rv = smtpService->SendMailMessage(aFileSpec, buf, mUserIdentity,
|
||||||
uriListener, nsnull, msgStatus,
|
mSmtpPassword.get(), uriListener, msgStatus,
|
||||||
callbacks, nsnull, getter_AddRefs(mRunningRequest));
|
callbacks, nsnull, getter_AddRefs(mRunningRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3521,7 +3524,8 @@ nsMsgComposeAndSend::CreateAndSendMessage(
|
||||||
void *relatedPart,
|
void *relatedPart,
|
||||||
nsIDOMWindowInternal *parentWindow,
|
nsIDOMWindowInternal *parentWindow,
|
||||||
nsIMsgProgress *progress,
|
nsIMsgProgress *progress,
|
||||||
nsIMsgSendListener *aListener
|
nsIMsgSendListener *aListener,
|
||||||
|
const char *password
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -3544,7 +3548,8 @@ nsMsgComposeAndSend::CreateAndSendMessage(
|
||||||
digest_p, dont_deliver_p, mode, msgToReplace,
|
digest_p, dont_deliver_p, mode, msgToReplace,
|
||||||
attachment1_type, attachment1_body,
|
attachment1_type, attachment1_body,
|
||||||
attachment1_body_length,
|
attachment1_body_length,
|
||||||
attachments, preloaded_attachments);
|
attachments, preloaded_attachments,
|
||||||
|
password);
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
@ -3556,12 +3561,13 @@ nsresult
|
||||||
nsMsgComposeAndSend::SendMessageFile(
|
nsMsgComposeAndSend::SendMessageFile(
|
||||||
nsIMsgIdentity *aUserIndentity,
|
nsIMsgIdentity *aUserIndentity,
|
||||||
nsIMsgCompFields *fields,
|
nsIMsgCompFields *fields,
|
||||||
nsIFileSpec *sendIFileSpec,
|
nsIFileSpec *sendIFileSpec,
|
||||||
PRBool deleteSendFileOnCompletion,
|
PRBool deleteSendFileOnCompletion,
|
||||||
PRBool digest_p,
|
PRBool digest_p,
|
||||||
nsMsgDeliverMode mode,
|
nsMsgDeliverMode mode,
|
||||||
nsIMsgDBHdr *msgToReplace,
|
nsIMsgDBHdr *msgToReplace,
|
||||||
nsIMsgSendListener *aListener
|
nsIMsgSendListener *aListener,
|
||||||
|
const char *password
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -3606,11 +3612,11 @@ nsMsgComposeAndSend::SendMessageFile(
|
||||||
rv = Init(aUserIndentity, (nsMsgCompFields *)fields, sendFileSpec,
|
rv = Init(aUserIndentity, (nsMsgCompFields *)fields, sendFileSpec,
|
||||||
digest_p, PR_FALSE, mode, msgToReplace,
|
digest_p, PR_FALSE, mode, msgToReplace,
|
||||||
nsnull, nsnull, nsnull,
|
nsnull, nsnull, nsnull,
|
||||||
nsnull, nsnull);
|
nsnull, nsnull,
|
||||||
if (NS_SUCCEEDED(rv))
|
password);
|
||||||
{
|
|
||||||
|
if (NS_SUCCEEDED(rv))
|
||||||
return DeliverMessage();
|
return DeliverMessage();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,7 +234,8 @@ public:
|
||||||
const char *attachment1_body,
|
const char *attachment1_body,
|
||||||
PRUint32 attachment1_body_length,
|
PRUint32 attachment1_body_length,
|
||||||
const nsMsgAttachmentData *attachments,
|
const nsMsgAttachmentData *attachments,
|
||||||
const nsMsgAttachedFile *preloaded_attachments);
|
const nsMsgAttachedFile *preloaded_attachments,
|
||||||
|
const char *password);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Setup the composition fields
|
// Setup the composition fields
|
||||||
|
@ -382,6 +383,8 @@ protected:
|
||||||
private:
|
private:
|
||||||
// will set m_attachment1_body & m_attachment1_body_length;
|
// will set m_attachment1_body & m_attachment1_body_length;
|
||||||
nsresult EnsureLineBreaks(const char *body, PRUint32 body_len);
|
nsresult EnsureLineBreaks(const char *body, PRUint32 body_len);
|
||||||
|
|
||||||
|
nsCString mSmtpPassword; // store the smtp Password use during a send
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -522,7 +522,8 @@ nsCOMPtr<nsIMsgSend> pMsgSend = nsnull;
|
||||||
PR_FALSE, // PRBool digest_p,
|
PR_FALSE, // PRBool digest_p,
|
||||||
nsIMsgSend::nsMsgDeliverNow, // nsMsgDeliverMode mode,
|
nsIMsgSend::nsMsgDeliverNow, // nsMsgDeliverMode mode,
|
||||||
nsnull, // nsIMsgDBHdr *msgToReplace,
|
nsnull, // nsIMsgDBHdr *msgToReplace,
|
||||||
sendListener);
|
sendListener,
|
||||||
|
nsnull);
|
||||||
NS_IF_RELEASE(sendListener);
|
NS_IF_RELEASE(sendListener);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,8 +92,8 @@ NS_IMPL_ISUPPORTS2(nsSmtpService, nsISmtpService, nsIProtocolHandler);
|
||||||
nsresult nsSmtpService::SendMailMessage(nsIFileSpec * aFilePath,
|
nsresult nsSmtpService::SendMailMessage(nsIFileSpec * aFilePath,
|
||||||
const char * aRecipients,
|
const char * aRecipients,
|
||||||
nsIMsgIdentity * aSenderIdentity,
|
nsIMsgIdentity * aSenderIdentity,
|
||||||
|
const char * aPassword,
|
||||||
nsIUrlListener * aUrlListener,
|
nsIUrlListener * aUrlListener,
|
||||||
nsISmtpServer * aServer,
|
|
||||||
nsIMsgStatusFeedback *aStatusFeedback,
|
nsIMsgStatusFeedback *aStatusFeedback,
|
||||||
nsIInterfaceRequestor* aNotificationCallbacks,
|
nsIInterfaceRequestor* aNotificationCallbacks,
|
||||||
nsIURI ** aURL,
|
nsIURI ** aURL,
|
||||||
|
@ -119,6 +119,9 @@ nsresult nsSmtpService::SendMailMessage(nsIFileSpec * aFilePath,
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv) && smtpServer)
|
if (NS_SUCCEEDED(rv) && smtpServer)
|
||||||
{
|
{
|
||||||
|
if (aPassword && *aPassword)
|
||||||
|
smtpServer->SetPassword(aPassword);
|
||||||
|
|
||||||
nsXPIDLCString smtpHostName;
|
nsXPIDLCString smtpHostName;
|
||||||
nsXPIDLCString smtpUserName;
|
nsXPIDLCString smtpUserName;
|
||||||
|
|
||||||
|
|
|
@ -610,23 +610,23 @@ nsresult nsEudoraCompose::SendTheMessage( nsIFileSpec *pMsg)
|
||||||
ExtractType( bodyType);
|
ExtractType( bodyType);
|
||||||
ExtractCharset( headerVal);
|
ExtractCharset( headerVal);
|
||||||
// Use platform charset as default if the msg doesn't specify one
|
// Use platform charset as default if the msg doesn't specify one
|
||||||
// (ie, no 'charset' param in the Content-Type: header). As the last
|
// (ie, no 'charset' param in the Content-Type: header). As the last
|
||||||
// resort we'll use the mail defaul charset.
|
// resort we'll use the mail defaul charset.
|
||||||
if (! headerVal.Length())
|
if (! headerVal.Length())
|
||||||
{
|
{
|
||||||
headerVal = nsMsgI18NFileSystemCharset();
|
headerVal = nsMsgI18NFileSystemCharset();
|
||||||
if (! headerVal.Length())
|
if (! headerVal.Length())
|
||||||
{ // last resort
|
{ // last resort
|
||||||
if (!m_defCharset.Length())
|
if (!m_defCharset.Length())
|
||||||
{
|
{
|
||||||
char *pSet = nsMsgI18NGetDefaultMailCharset();
|
char *pSet = nsMsgI18NGetDefaultMailCharset();
|
||||||
m_defCharset.AssignWithConversion(pSet);
|
m_defCharset.AssignWithConversion(pSet);
|
||||||
nsCRT::free( pSet);
|
nsCRT::free( pSet);
|
||||||
}
|
}
|
||||||
headerVal = m_defCharset;
|
headerVal = m_defCharset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_pMsgFields->SetCharacterSet( nsAutoCString(headerVal) );
|
m_pMsgFields->SetCharacterSet( nsAutoCString(headerVal) );
|
||||||
charSet = headerVal;
|
charSet = headerVal;
|
||||||
GetHeaderValue( m_pHeaders, m_headerLen, "CC:", headerVal);
|
GetHeaderValue( m_pHeaders, m_headerLen, "CC:", headerVal);
|
||||||
if (headerVal.Length())
|
if (headerVal.Length())
|
||||||
|
@ -677,41 +677,45 @@ nsresult nsEudoraCompose::SendTheMessage( nsIFileSpec *pMsg)
|
||||||
|
|
||||||
if (NS_FAILED( rv)) {
|
if (NS_FAILED( rv)) {
|
||||||
|
|
||||||
rv = m_pSendProxy->CreateAndSendMessage( nsnull, // no editor shell
|
rv = m_pSendProxy->CreateAndSendMessage(
|
||||||
m_pIdentity, // dummy identity
|
nsnull, // no editor shell
|
||||||
m_pMsgFields, // message fields
|
m_pIdentity, // dummy identity
|
||||||
PR_FALSE, // digest = NO
|
m_pMsgFields, // message fields
|
||||||
PR_TRUE, // dont_deliver = YES, make a file
|
PR_FALSE, // digest = NO
|
||||||
nsIMsgSend::nsMsgDeliverNow, // mode
|
PR_TRUE, // dont_deliver = YES, make a file
|
||||||
nsnull, // no message to replace
|
nsIMsgSend::nsMsgDeliverNow, // mode
|
||||||
pMimeType, // body type
|
nsnull, // no message to replace
|
||||||
m_pBody, // body pointer
|
pMimeType, // body type
|
||||||
m_bodyLen, // body length
|
m_pBody, // body pointer
|
||||||
nsnull, // remote attachment data
|
m_bodyLen, // body length
|
||||||
pAttach, // local attachments
|
nsnull, // remote attachment data
|
||||||
nsnull, // related part
|
pAttach, // local attachments
|
||||||
nsnull, // parent window
|
nsnull, // related part
|
||||||
nsnull, // progress listener
|
nsnull, // parent window
|
||||||
m_pListener); // listener
|
nsnull, // progress listener
|
||||||
|
m_pListener, // listener
|
||||||
|
nsnull); // password
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rv = m_pSendProxy->CreateAndSendMessage( nsnull, // no editor shell
|
rv = m_pSendProxy->CreateAndSendMessage(
|
||||||
m_pIdentity, // dummy identity
|
nsnull, // no editor shell
|
||||||
m_pMsgFields, // message fields
|
m_pIdentity, // dummy identity
|
||||||
PR_FALSE, // digest = NO
|
m_pMsgFields, // message fields
|
||||||
PR_TRUE, // dont_deliver = YES, make a file
|
PR_FALSE, // digest = NO
|
||||||
nsIMsgSend::nsMsgDeliverNow, // mode
|
PR_TRUE, // dont_deliver = YES, make a file
|
||||||
nsnull, // no message to replace
|
nsIMsgSend::nsMsgDeliverNow, // mode
|
||||||
pMimeType, // body type
|
nsnull, // no message to replace
|
||||||
body, // body pointer
|
pMimeType, // body type
|
||||||
body.Length(), // body length
|
body, // body pointer
|
||||||
nsnull, // remote attachment data
|
body.Length(), // body length
|
||||||
pAttach, // local attachments
|
nsnull, // remote attachment data
|
||||||
nsnull, // related part
|
pAttach, // local attachments
|
||||||
nsnull, // parent window
|
nsnull, // related part
|
||||||
nsnull, // progress listener
|
nsnull, // parent window
|
||||||
m_pListener); // listener
|
nsnull, // progress listener
|
||||||
|
m_pListener, // listener
|
||||||
|
nsnull); // password
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -621,22 +621,24 @@ nsresult nsOutlookCompose::SendTheMessage( nsIFileSpec *pMsg)
|
||||||
// IMPORT_LOG0( "Outlook compose calling CreateAndSendMessage\n");
|
// IMPORT_LOG0( "Outlook compose calling CreateAndSendMessage\n");
|
||||||
nsMsgAttachedFile *pAttach = GetLocalAttachments();
|
nsMsgAttachedFile *pAttach = GetLocalAttachments();
|
||||||
|
|
||||||
rv = m_pSendProxy->CreateAndSendMessage( nsnull, // no editor shell
|
rv = m_pSendProxy->CreateAndSendMessage(
|
||||||
m_pIdentity, // dummy identity
|
nsnull, // no editor shell
|
||||||
m_pMsgFields, // message fields
|
m_pIdentity, // dummy identity
|
||||||
PR_FALSE, // digest = NO
|
m_pMsgFields, // message fields
|
||||||
PR_TRUE, // dont_deliver = YES, make a file
|
PR_FALSE, // digest = NO
|
||||||
|
PR_TRUE, // dont_deliver = YES, make a file
|
||||||
nsIMsgSend::nsMsgDeliverNow, // mode
|
nsIMsgSend::nsMsgDeliverNow, // mode
|
||||||
nsnull, // no message to replace
|
nsnull, // no message to replace
|
||||||
pMimeType, // body type
|
pMimeType, // body type
|
||||||
m_pBody, // body pointer
|
m_pBody, // body pointer
|
||||||
m_bodyLen, // body length
|
m_bodyLen, // body length
|
||||||
nsnull, // remote attachment data
|
nsnull, // remote attachment data
|
||||||
pAttach, // local attachments
|
pAttach, // local attachments
|
||||||
nsnull, // related part
|
nsnull, // related part
|
||||||
nsnull, // parent window
|
nsnull, // parent window
|
||||||
nsnull, // progress listener
|
nsnull, // progress listener
|
||||||
m_pListener); // listener
|
m_pListener, // listener
|
||||||
|
nsnull); // password
|
||||||
|
|
||||||
|
|
||||||
// IMPORT_LOG0( "Returned from CreateAndSendMessage\n");
|
// IMPORT_LOG0( "Returned from CreateAndSendMessage\n");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче