Bug 539066 - port bug 151244 to seamonkey, so return receipts keep working, r=IanN sr=Neil a=blocking-sm2.1a1+ for CLOSED TREE

This commit is contained in:
Philip Chee 2010-05-10 11:59:55 +08:00
Родитель 0aa1af7723
Коммит feba5dbb3a
8 изменённых файлов: 61 добавлений и 21 удалений

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

@ -608,3 +608,8 @@
<!-- Phishing Bar -->
<!ENTITY phishingBarMessage.label "&brandShortName; thinks this message might be an email scam.">
<!ENTITY removePhishingBarButton.label "Not a Scam">
<!-- MDN Bar -->
<!ENTITY mdnBarMessage.label "The sender of this message has asked to be notified when you read this message. Do you wish to notify the sender?">
<!ENTITY mdnBarIgnoreButton.label "Ignore Request">
<!ENTITY mdnBarSendButton.label "Send Receipt">

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

@ -41,9 +41,6 @@ MsgMdnProcessed=The message was processed by the recipient's mail client without
MsgMdnDeleted=The message has been deleted. The person you sent it to may or may not have seen it. They might undelete it at a later time and read it.
MsgMdnDenied=The recipient of the message does not wish to send a return receipt back to you.
MsgMdnFailed=A failure occurred. A proper return receipt could not be generated or sent to you.
MsgMdnWishToSend=The sender of this message has asked to be notified when you read this message.\n\nDo you wish to notify the sender?
MsgMdnIgnoreRequest=Ignore Request
MsgMdnSendReceipt=Send Receipt
# LOCALIZATION NOTE : Do not translate the word "%S" below.
MsgMdnMsgSentTo=This is a Return Receipt for the mail that you sent to %S.
MdnDisplayedReceipt=Return Receipt (displayed)

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

@ -70,6 +70,7 @@ const kNotAPhishMessage = 1;
const kMsgNotificationPhishingBar = 1;
const kMsgNotificationJunkBar = 2;
const kMsgNotificationRemoteImages = 3;
const kMsgNotificationMDN = 4;
const kMsgForwardAsAttachment = 0;
const kMsgForwardInline = 2;
@ -2539,7 +2540,8 @@ var gMessageNotificationBar =
0, // for no msgNotificationBar
1, // 1 << (kMsgNotificationPhishingBar - 1)
2, // 1 << (kMsgNotificationJunkBar - 1)
4 // 1 << (kMsgNotificationRemoteImages - 1)
4, // 1 << (kMsgNotificationRemoteImages - 1)
8 // 1 << (kMsgNotificationMDN - 1)
],
mMsgNotificationBar: document.getElementById('msgNotificationBar'),
@ -2581,6 +2583,12 @@ var gMessageNotificationBar =
this.updateMsgNotificationBar(kMsgNotificationPhishingBar, phishingMsg);
},
setMDNMsg: function(aMdnGenerator, aMsgHeader)
{
this.mdnGenerator = aMdnGenerator;
this.updateMsgNotificationBar(kMsgNotificationMDN, true);
},
clearMsgNotifications: function()
{
this.mBarStatus = 0;
@ -2893,24 +2901,28 @@ function HandleMDNResponse(aUrl)
return;
// Everything looks good so far, let's generate the MDN response.
var mdnGenerator = Components.classes["@mozilla.org/messenger-mdn/generator;1"].
createInstance(Components.interfaces.nsIMsgMdnGenerator);
mdnGenerator.process(Components.interfaces.nsIMsgMdnGenerator.eDisplayed,
msgWindow,
msgFolder,
msgHdr.messageKey,
mimeHdr,
false);
var mdnGenerator = Components.classes["@mozilla.org/messenger-mdn/generator;1"]
.createInstance(Components.interfaces.nsIMsgMdnGenerator);
var askUser = mdnGenerator.process(Components.interfaces.nsIMsgMdnGenerator.eDisplayed,
msgWindow,
msgFolder,
msgHdr.messageKey,
mimeHdr,
false);
if (askUser)
gMessageNotificationBar.setMDNMsg(mdnGenerator, msgHdr);
}
// Reset mark msg MDN "Sent" and "Not Needed".
msgHdr.flags = (msgFlags &
~Components.interfaces.nsMsgMessageFlags.MDNReportNeeded);
msgHdr.OrFlags(Components.interfaces.nsMsgMessageFlags.MDNReportSent);
function SendMDNResponse()
{
gMessageNotificationBar.mdnGenerator.userAgreed();
gMessageNotificationBar.updateMsgNotificationBar(kMsgNotificationMDN, false);
}
// Commit db changes.
var msgdb = msgFolder.msgDatabase;
if (msgdb)
msgdb.Commit(Components.interfaces.nsMsgDBCommitType.kLargeCommit);
function IgnoreMDNResponse()
{
gMessageNotificationBar.mdnGenerator.userDeclined();
gMessageNotificationBar.updateMsgNotificationBar(kMsgNotificationMDN, false);
}
function MsgSearchMessages()

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

@ -2350,6 +2350,18 @@
label="&loadRemoteContentButton.label;"
oncommand="LoadMsgWithRemoteContent();"/>
</hbox>
<hbox id="mdnBar"
class="msgNotificationBar"
align="center">
<image id="mdnBarImage"/>
<description flex="1"
class="msgNotificationBarText">&mdnBarMessage.label;</description>
<button label="&mdnBarIgnoreButton.label;"
oncommand="IgnoreMDNResponse();"/>
<button label="&mdnBarSendButton.label;"
oncommand="SendMDNResponse();"/>
</hbox>
</deck>
<statusbar class="chromeclass-status" id="status-bar">

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

@ -454,7 +454,6 @@ toolbar[iconsize="small"] > #button-stop[disabled="true"] {
.msgNotificationBar {
border-bottom: 1px solid #A5A5A5;
-moz-appearance: toolbox;
background-color: #C7BC8F;
color: black;
}
@ -477,6 +476,11 @@ toolbar[iconsize="small"] > #button-stop[disabled="true"] {
padding: 3px;
}
#mdnBarImage {
list-style-image: url("chrome://global/skin/icons/Question.png");
padding: 3px;
}
#allowRemoteContentForAuthorDesc {
-moz-padding-start: 10px;
}

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

@ -572,6 +572,11 @@ toolbar[iconsize="small"] > #button-stop[disabled="true"] {
padding: 3px;
}
#mdnBarImage {
list-style-image: url("chrome://global/skin/icons/Question.png");
padding: 3px;
}
#allowRemoteContentForAuthorDesc {
-moz-padding-start: 10px;
}

Двоичные данные
suite/themes/modern/global/icons/Question.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

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

@ -377,6 +377,11 @@ toolbar[iconsize="small"] #button-stop[disabled="true"] {
padding: 3px;
}
#mdnBarImage {
list-style-image: url("chrome://global/skin/icons/Question.png");
padding: 3px;
}
#allowRemoteContentForAuthorDesc {
-moz-padding-start: 10px;
}