From 9112b1ff49e2c3305a3efbd844e7364af18d9d7a Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Tue, 18 Sep 2007 22:37:04 +0000 Subject: [PATCH] add support for DSN return receipts, patch by eballetbaz@gmail.com, r=bienvenu, sr=mscott --- .../compose/content/MsgComposeCommands.js | 25 ++++ .../compose/content/messengercompose.xul | 2 + .../messengercompose/messengercompose.dtd | 2 + mailnews/base/public/nsIMsgIdentity.idl | 10 +- mailnews/base/util/nsMsgIdentity.cpp | 17 +++ mailnews/compose/public/nsIMsgCompFields.idl | 4 +- mailnews/compose/public/nsISmtpService.idl | 4 +- mailnews/compose/public/nsISmtpUrl.idl | 5 +- mailnews/compose/src/nsMsgCompFields.cpp | 15 +++ mailnews/compose/src/nsMsgCompFields.h | 3 + mailnews/compose/src/nsMsgCompUtils.cpp | 6 + mailnews/compose/src/nsMsgCompose.cpp | 7 ++ mailnews/compose/src/nsMsgSend.cpp | 5 +- mailnews/compose/src/nsSmtpProtocol.cpp | 118 ++++++++++++------ mailnews/compose/src/nsSmtpService.cpp | 11 +- mailnews/compose/src/nsSmtpUrl.cpp | 4 + mailnews/compose/src/nsSmtpUrl.h | 2 + .../extensions/mdn/src/nsMsgMdnGenerator.cpp | 2 +- mailnews/mailnews.js | 8 ++ mailnews/mime/src/mimedrft.cpp | 4 + 20 files changed, 205 insertions(+), 49 deletions(-) diff --git a/mail/components/compose/content/MsgComposeCommands.js b/mail/components/compose/content/MsgComposeCommands.js index 86b2444ebf2..0020d381b12 100644 --- a/mail/components/compose/content/MsgComposeCommands.js +++ b/mail/components/compose/content/MsgComposeCommands.js @@ -22,6 +22,7 @@ # # Contributor(s): # David Bienvenu +# Olivier Parniere BT Global Services / Etat francais Ministere de la Defense # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -117,6 +118,7 @@ var gCharsetConvertManager; var gLastWindowToHaveFocus; var gReceiptOptionChanged; +var gDSNOptionChanged; var gAttachVCardOptionChanged; var gMailSession; @@ -161,6 +163,7 @@ function InitializeGlobalVariables() gLastWindowToHaveFocus = null; gReceiptOptionChanged = false; + gDSNOptionChanged = false; gAttachVCardOptionChanged = false; } InitializeGlobalVariables(); @@ -1306,6 +1309,7 @@ function ComposeStartup(recycled, aParams) document.getElementById("returnReceiptMenu").setAttribute('checked', gMsgCompose.compFields.returnReceipt); + document.getElementById("dsnMenu").setAttribute('checked', gMsgCompose.compFields.DSN); document.getElementById("cmd_attachVCard").setAttribute('checked', gMsgCompose.compFields.attachVCard); document.getElementById("menu_inlineSpellCheck").setAttribute('checked', sPrefs.getBoolPref("mail.spellcheck.inline")); @@ -2293,6 +2297,17 @@ function ToggleReturnReceipt(target) } } +function ToggleDSN(target) +{ + var msgCompFields = gMsgCompose.compFields; + if (msgCompFields) + { + msgCompFields.DSN = ! msgCompFields.DSN; + target.setAttribute('checked', msgCompFields.DSN); + gDSNOptionChanged = true; + } +} + function ToggleAttachVCard(target) { var msgCompFields = gMsgCompose.compFields; @@ -3015,6 +3030,7 @@ function LoadIdentity(startup) var prevReplyTo = prevIdentity.replyTo; var prevBcc = ""; var prevReceipt = prevIdentity.requestReturnReceipt; + var prevDSN = prevIdentity.DSN; var prevAttachVCard = prevIdentity.attachVCard; if (prevIdentity.doBcc) @@ -3023,6 +3039,7 @@ function LoadIdentity(startup) var newReplyTo = gCurrentIdentity.replyTo; var newBcc = ""; var newReceipt = gCurrentIdentity.requestReturnReceipt; + var newDSN = gCurrentIdentity.DSN; var newAttachVCard = gCurrentIdentity.attachVCard; if (gCurrentIdentity.doBcc) @@ -3039,6 +3056,14 @@ function LoadIdentity(startup) document.getElementById("returnReceiptMenu").setAttribute('checked',msgCompFields.returnReceipt); } + if (!gDSNOptionChanged && + prevDSN == msgCompFields.DSN && + prevDSN != newDSN) + { + msgCompFields.DSN = newDSN; + document.getElementById("dsnMenu").setAttribute('checked',msgCompFields.DSN); + } + if (!gAttachVCardOptionChanged && prevAttachVCard == msgCompFields.attachVCard && prevAttachVCard != newAttachVCard) diff --git a/mail/components/compose/content/messengercompose.xul b/mail/components/compose/content/messengercompose.xul index 38c310d68fd..88e7028ea3f 100644 --- a/mail/components/compose/content/messengercompose.xul +++ b/mail/components/compose/content/messengercompose.xul @@ -24,6 +24,7 @@ # Ben Goodger (ass'td polish fixes) # Hkan Waara # Neil Rashbrook (ass'td polish fix) +# Olivier Parniere BT Global Services / Etat francais Ministere de la Defense # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -430,6 +431,7 @@ +