Fix bug 22141. Recipients are by default non html compliant. R=alecf@netscape.com

This commit is contained in:
ducarroz%netscape.com 2000-02-15 21:25:31 +00:00
Родитель c3a582657f
Коммит 3c05a8ded2
2 изменённых файлов: 21 добавлений и 10 удалений

Просмотреть файл

@ -780,31 +780,33 @@ function DetermineHTMLAction()
//Well, before we ask, see if we can figure out what to do for ourselves
var noHtmlRecipients;
var newsgroups;
var noHtmlnewsgroups;
//Check the address book for the HTML property for each recipient
try {
noHtmlRecipients = msgCompose.GetNoHtmlRecipients(null);
} catch(ex)
{
noHtmlRecipients = "";
var msgCompFields = msgCompose.compFields;
noHtmlRecipients = msgCompFields.GetTo() + "," + msgCompFields.GetCc() + "," + msgCompFields.GetBcc();
}
dump("DetermineHTMLAction: noHtmlRecipients are " + noHtmlRecipients + "\n");
//Check newsgroups now...
try {
newsgroups = msgCompose.GetNoHtmlNewsgroups(null);
noHtmlnewsgroups = msgCompose.GetNoHtmlNewsgroups(null);
} catch(ex)
{
newsgroups = msgCompose.compFields.GetNewsgroups();
noHtmlnewsgroups = msgCompose.compFields.GetNewsgroups();
}
if (noHtmlRecipients != "" || newsgroups != "")
if (noHtmlRecipients != "" || noHtmlnewsgroups != "")
{
//Do we really need to send in HTML?
//FIX ME: need to ask editor is the body containg any formatting or non plaint text elements.
if (newsgroups == "")
if (noHtmlnewsgroups == "")
{
//See if a preference has been set to tell us what to do. Note that we do not honor that
//preference for newsgroups. Only for e-mail addresses.

Просмотреть файл

@ -2124,15 +2124,24 @@ nsresult nsMsgCompose::GetNoHtmlRecipients(const PRUnichar *recipients, PRUnicha
}
//now, build the result
noHTMLArray->GetCount(&nbrRecipients);
recipientStr = "";
noHTMLArray->GetCount(&nbrRecipients);
for (i = 0; i < nbrRecipients; i ++)
{
if (i > 0)
if (! recipientStr.IsEmpty())
recipientStr += ',';
noHTMLArray->StringAt(i, getter_Copies(emailAddr));
recipientStr += emailAddr;
}
}
//Remaining recipients which do not have an entry in the AB are considered as non HTML compliant
array->GetCount(&nbrRecipients);
for (i = 0; i < nbrRecipients; i ++)
{
if (! recipientStr.IsEmpty())
recipientStr += ',';
array->StringAt(i, getter_Copies(emailAddr));
recipientStr += emailAddr;
}
*_retval = recipientStr.ToNewUnicode();
return NS_OK;