зеркало из https://github.com/mozilla/pjs.git
Bug #28984 --> add a getter & setter for recipients. The recipients are now stored as a field in the smtp url
instead of as part of the url spec. r=sspitzer a=phil
This commit is contained in:
Родитель
49519e5eed
Коммит
ee923ac9ba
|
@ -1269,7 +1269,7 @@ nsresult nsSmtpProtocol::LoadUrl(nsIURI * aURL, nsISupports * aConsumer )
|
|||
nsXPIDLCString addresses;
|
||||
nsCOMPtr<nsIMsgHeaderParser> parser = do_GetService(kHeaderParserCID);
|
||||
|
||||
m_runningURL->GetAllRecipients(getter_Copies(addresses));
|
||||
m_runningURL->GetRecipients(getter_Copies(addresses));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && parser)
|
||||
{
|
||||
|
|
|
@ -440,27 +440,28 @@ nsresult nsSmtpUrl::ParseUrl()
|
|||
|
||||
// set the username
|
||||
nsXPIDLCString userName;
|
||||
rv = GetPreHost(getter_Copies(userName));
|
||||
rv = GetUsername(getter_Copies(userName));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
m_userName = (const char *)userName;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// the recipients should consist of just the path part up to to the query
|
||||
// part
|
||||
nsXPIDLCString toPart;
|
||||
rv = GetFileName(getter_Copies(toPart));
|
||||
m_toPart = toPart;
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSmtpUrl::SetRecipients(const char * aRecipientsList)
|
||||
{
|
||||
NS_ENSURE_ARG(aRecipientsList);
|
||||
m_toPart = aRecipientsList;
|
||||
if (!m_toPart.IsEmpty())
|
||||
nsUnescape(m_toPart);
|
||||
return rv;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
// Caller must call PR_FREE on list when it is done with it. This list is a list of all
|
||||
// recipients to send the email to. each name is NULL terminated...
|
||||
NS_IMETHODIMP
|
||||
nsSmtpUrl::GetAllRecipients(char ** aRecipientsList)
|
||||
nsSmtpUrl::GetRecipients(char ** aRecipientsList)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aRecipientsList);
|
||||
if (aRecipientsList)
|
||||
*aRecipientsList = m_toPart.ToNewCString();
|
||||
return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче