From aae9e6abd8fa93f0246112b3775bedf9a86a8a43 Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Mon, 2 May 2005 15:07:15 +0000 Subject: [PATCH] fix 285474 display sender header if it's different than from header, sr=mscott, a=chofmann --- mail/base/content/msgHdrViewOverlay.js | 20 +++++++++++++++---- mail/base/content/msgHdrViewOverlay.xul | 1 + .../chrome/messenger/msgHdrViewOverlay.dtd | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mail/base/content/msgHdrViewOverlay.js b/mail/base/content/msgHdrViewOverlay.js index 0cd1a2dc10af..759cfd319ef2 100644 --- a/mail/base/content/msgHdrViewOverlay.js +++ b/mail/base/content/msgHdrViewOverlay.js @@ -127,6 +127,7 @@ var gCollapsedHeaderList = [ {name:"subject", outputFunction:updateHeaderValueIn // We also have an expanded header view. This shows many of your more common (and useful) headers. var gExpandedHeaderList = [ {name:"subject"}, {name:"from", outputFunction:OutputEmailAddresses}, + {name:"sender", outputFunction:OutputEmailAddresses}, {name:"reply-to", outputFunction:OutputEmailAddresses}, {name:"date"}, {name:"to", useToggle:true, outputFunction:OutputEmailAddresses}, @@ -358,7 +359,9 @@ var messageHeaderSink = { processHeaders: function(headerNameEnumerator, headerValueEnumerator, dontCollectAddress) { this.onStartHeaders(); + var fromMailbox; + var index = 0; while (headerNameEnumerator.hasMore()) { var header = new Object; @@ -374,6 +377,11 @@ var messageHeaderSink = { if (lowerCaseHeaderName == "x-mailer" || lowerCaseHeaderName == "x-mimeole") lowerCaseHeaderName = "user-agent"; + if (lowerCaseHeaderName == "sender") + { + if (fromMailbox == header.headerValue) + continue; + } // according to RFC 2822, certain headers // can occur "unlimited" times if (lowerCaseHeaderName in currentHeaderData) @@ -393,6 +401,9 @@ var messageHeaderSink = { if (lowerCaseHeaderName == "from") { + if (msgHeaderParser && header.value) + fromMailbox = msgHeaderParser.extractHeaderAddressMailboxes(null, header.value); + if (header.value) { if ((gCollectIncoming && !dontCollectAddress) || (gCollectNewsgroup && dontCollectAddress)) @@ -687,9 +698,9 @@ function createNewHeaderView(headerName) } else { - newHeader.setAttribute('label', currentHeaderData[headerName].headerName + ':'); - // all mail-headerfield elements are keyword related - newHeader.setAttribute('keywordrelated','true'); + newHeader.setAttribute('label', currentHeaderData[headerName].headerName + ':'); + // all mail-headerfield elements are keyword related + newHeader.setAttribute('keywordrelated','true'); } newHeader.collapsed = true; @@ -740,7 +751,7 @@ function UpdateMessageHeaders() else if (!gCollapsedHeaderViewMode && !gBuiltExpandedView) { if (headerName in gExpandedHeaderView) - headerEntry = gExpandedHeaderView[headerName]; + headerEntry = gExpandedHeaderView[headerName]; if (!headerEntry && gViewAllHeaders) { @@ -883,6 +894,7 @@ function OutputEmailAddresses(headerEntry, emailAddresses) } // if msgheader parser } + function setFromBuddyIcon(email) { var fromBuddyIcon = document.getElementById("fromBuddyIcon"); diff --git a/mail/base/content/msgHdrViewOverlay.xul b/mail/base/content/msgHdrViewOverlay.xul index f0fe55f7a082..7113d3cb16f1 100644 --- a/mail/base/content/msgHdrViewOverlay.xul +++ b/mail/base/content/msgHdrViewOverlay.xul @@ -146,6 +146,7 @@ + diff --git a/mail/locales/en-US/chrome/messenger/msgHdrViewOverlay.dtd b/mail/locales/en-US/chrome/messenger/msgHdrViewOverlay.dtd index c1b3fffaf9ac..208f3d86d33f 100644 --- a/mail/locales/en-US/chrome/messenger/msgHdrViewOverlay.dtd +++ b/mail/locales/en-US/chrome/messenger/msgHdrViewOverlay.dtd @@ -37,6 +37,7 @@ +