Show the user agent string again if the user has the hidden pref set.

If we receive multiple "To" or "cc" headers in the same message, aggregate them
instead of just using the last one.
This commit is contained in:
mscott%netscape.com 2001-03-29 03:27:41 +00:00
Родитель 8ad2a1e5c4
Коммит 53221e07c2
2 изменённых файлов: 28 добавлений и 5 удалений

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

@ -170,6 +170,13 @@ function initializeHeaderViewTables()
var headerName = gExpandedHeaderList[index].name; var headerName = gExpandedHeaderList[index].name;
gExpandedHeaderView[headerName] = new createHeaderEntry('expanded', gExpandedHeaderList[index]); gExpandedHeaderView[headerName] = new createHeaderEntry('expanded', gExpandedHeaderList[index]);
} }
if (gShowUserAgent)
{
var userAgentEntry = {name:"user-agent", outputFunction:updateHeaderValueInTextNode};
gExpandedHeaderView[userAgentEntry.name] = new createHeaderEntry('expanded', userAgentEntry);
}
} }
function OnLoadMsgHeaderPane() function OnLoadMsgHeaderPane()
@ -178,15 +185,14 @@ function OnLoadMsgHeaderPane()
// otherwise we have problems. // otherwise we have problems.
document.loadBindingDocument('chrome://messenger/content/mailWidgets.xml'); document.loadBindingDocument('chrome://messenger/content/mailWidgets.xml');
initializeHeaderViewTables();
// load any preferences that at are global with regards to // load any preferences that at are global with regards to
// displaying a message... // displaying a message...
gNumAddressesToShow = pref.GetIntPref("mailnews.max_header_display_length"); gNumAddressesToShow = pref.GetIntPref("mailnews.max_header_display_length");
gShowUserAgent = pref.GetBoolPref("mailnews.headers.showUserAgent");
gCollectIncoming = pref.GetBoolPref("mail.collect_email_address_incoming"); gCollectIncoming = pref.GetBoolPref("mail.collect_email_address_incoming");
gCollectNewsgroup = pref.GetBoolPref("mail.collect_email_address_newsgroup"); gCollectNewsgroup = pref.GetBoolPref("mail.collect_email_address_newsgroup");
gShowUserAgent = pref.GetBoolPref("mailnews.headers.showUserAgent");
initializeHeaderViewTables();
} }
// The messageHeaderSink is the class that gets notified of a message's headers as we display the message // The messageHeaderSink is the class that gets notified of a message's headers as we display the message
@ -241,7 +247,16 @@ var messageHeaderSink = {
var foo = new Object; var foo = new Object;
foo.headerValue = headerValue; foo.headerValue = headerValue;
foo.headerName = headerName; foo.headerName = headerName;
currentHeaderData[lowerCaseHeaderName] = foo;
// some times, you can have multiple To or cc lines....in this case, we want to APPEND
// these headers into one.
if ( (lowerCaseHeaderName == 'to' || lowerCaseHeaderName == 'cc') && ( lowerCaseHeaderName in currentHeaderData))
{
currentHeaderData[lowerCaseHeaderName].headerValue = currentHeaderData[lowerCaseHeaderName].headerValue + ',' + foo.headerValue;
}
else
currentHeaderData[lowerCaseHeaderName] = foo;
if (lowerCaseHeaderName == "from") if (lowerCaseHeaderName == "from")
{ {
if (headerValue && abAddressCollector && if (headerValue && abAddressCollector &&
@ -440,6 +455,7 @@ function ShowMessageHeaderPane()
if (messagePaneBox && gFolderJustSwitched) if (messagePaneBox && gFolderJustSwitched)
{ {
messagePaneBox.setAttribute("collapsed", "false"); messagePaneBox.setAttribute("collapsed", "false");
messagePaneBox.removeAttribute("collapsed");
gFolderJustSwitched = false; gFolderJustSwitched = false;
} }
} }

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

@ -131,6 +131,13 @@ Rights Reserved.
</hbox> </hbox>
<html id="expandedfollowup-toValue" class="headerValue" flex="1">*</html> <html id="expandedfollowup-toValue" class="headerValue" flex="1">*</html>
</hbox> </hbox>
<hbox id="expandeduser-agentBox" class="headerBox" collapsed="true">
<hbox class="headerValueBox">
<text class="headerdisplayname" value="&userAgentField.label;"/>
</hbox>
<text id="expandeduser-agentValue" class="collapsedHeaderValue" flex="1"/>
</hbox>
</vbox> </vbox>