зеркало из https://github.com/mozilla/gecko-dev.git
Pass in a url listener to send message.
This commit is contained in:
Родитель
4f87709075
Коммит
9e2014ff2d
|
@ -30,7 +30,8 @@
|
|||
|
||||
// foward declarations...
|
||||
|
||||
nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender, const nsString& aRecipients, nsIURL ** aUrl);
|
||||
nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender,
|
||||
const nsString& aRecipients, nsIUrlListener *, nsIURL ** aUrl);
|
||||
nsresult NS_MsgLoadMailtoUrl(nsIURL * aUrl, nsISupports * aConsumer);
|
||||
|
||||
nsSmtpService::nsSmtpService()
|
||||
|
@ -43,13 +44,14 @@ nsSmtpService::~nsSmtpService()
|
|||
|
||||
NS_IMPL_THREADSAFE_ISUPPORTS(nsSmtpService, nsISmtpService::IID());
|
||||
|
||||
nsresult nsSmtpService::SendMailMessage(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender, const nsString& aRecipients, nsIURL ** aURL)
|
||||
nsresult nsSmtpService::SendMailMessage(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender,
|
||||
const nsString& aRecipients, nsIUrlListener * aUrlListener, nsIURL ** aURL)
|
||||
{
|
||||
nsIURL * urlToRun = nsnull;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
NS_LOCK_INSTANCE();
|
||||
rv = NS_MsgBuildMailtoUrl(aFilePath, aHostName, aSender, aRecipients, &urlToRun); // this ref counts urlToRun
|
||||
rv = NS_MsgBuildMailtoUrl(aFilePath, aHostName, aSender, aRecipients, aUrlListener, &urlToRun); // this ref counts urlToRun
|
||||
if (NS_SUCCEEDED(rv) && urlToRun)
|
||||
{
|
||||
rv = NS_MsgLoadMailtoUrl(urlToRun, nsnull);
|
||||
|
@ -70,7 +72,8 @@ nsresult nsSmtpService::SendMailMessage(const nsFilePath& aFilePath, const nsStr
|
|||
#define TEMP_DEFAULT_HOST "nsmail-2.mcom.com:25"
|
||||
|
||||
// short cut function for creating a mailto url...
|
||||
nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender, const nsString& aRecipients, nsIURL ** aUrl)
|
||||
nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender,
|
||||
const nsString& aRecipients, nsIUrlListener * aUrlListener, nsIURL ** aUrl)
|
||||
{
|
||||
// mscott: this function is a convience hack until netlib actually dispatches smtp urls.
|
||||
// in addition until we have a session to get a password, host and other stuff from, we need to use default values....
|
||||
|
@ -94,6 +97,7 @@ nsresult NS_MsgBuildMailtoUrl(const nsFilePath& aFilePath, const nsString& aHost
|
|||
smtpUrl->ParseURL(urlSpec); // load the spec we were given...
|
||||
smtpUrl->SetPostMessageFile(aFilePath);
|
||||
smtpUrl->SetUserEmailAddress(aSender);
|
||||
smtpUrl->RegisterListener(aUrlListener);
|
||||
PR_Free(urlSpec);
|
||||
}
|
||||
rv = smtpUrl->QueryInterface(nsISmtpUrl::IID(), (void **) aUrl);
|
||||
|
|
|
@ -50,7 +50,8 @@ public:
|
|||
// the returned URL.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
NS_IMETHOD SendMailMessage(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender, const nsString& aRecipients, nsIURL ** aURL);
|
||||
NS_IMETHOD SendMailMessage(const nsFilePath& aFilePath, const nsString& aHostName, const nsString& aSender,
|
||||
const nsString& aRecipients, nsIUrlListener * aUrlListener, nsIURL ** aURL);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
// End support of nsISmtpService interface
|
||||
|
|
Загрузка…
Ссылка в новой задаче