fixed bug 129418, Switching identity should retain request for MDN receipt options; r=ducarroz, sr=bienvenu

This commit is contained in:
jefft%netscape.com 2002-04-15 03:03:12 +00:00
Родитель 10422610d8
Коммит ae8d2257a0
1 изменённых файлов: 17 добавлений и 0 удалений

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

@ -91,6 +91,7 @@ var gCharsetConvertManager;
var gLastElementToHaveFocus; var gLastElementToHaveFocus;
var gSuppressCommandUpdating; var gSuppressCommandUpdating;
var gReceiptOptionChanged;
const kComposeAttachDirPrefName = "mail.compose.attach.dir"; const kComposeAttachDirPrefName = "mail.compose.attach.dir";
@ -132,6 +133,7 @@ function InitializeGlobalVariables()
gLastElementToHaveFocus = null; gLastElementToHaveFocus = null;
gSuppressCommandUpdating = false; gSuppressCommandUpdating = false;
gReceiptOptionChanged = false;
} }
InitializeGlobalVariables(); InitializeGlobalVariables();
@ -1871,6 +1873,8 @@ function ToggleReturnReceipt(target)
{ {
msgCompFields.returnReceipt = ! msgCompFields.returnReceipt; msgCompFields.returnReceipt = ! msgCompFields.returnReceipt;
target.setAttribute('checked', msgCompFields.returnReceipt); target.setAttribute('checked', msgCompFields.returnReceipt);
if (!gReceiptOptionChanged)
gReceiptOptionChanged = true;
} }
} }
@ -2398,6 +2402,8 @@ function LoadIdentity(startup)
RemoveDirectoryServerObserver(prefstring); RemoveDirectoryServerObserver(prefstring);
var prevReplyTo = prevIdentity.replyTo; var prevReplyTo = prevIdentity.replyTo;
var prevBcc = ""; var prevBcc = "";
var prevReceipt =
prevIdentity.getBoolAttribute("request_return_receipt_on");
if (prevIdentity.bccSelf) if (prevIdentity.bccSelf)
prevBcc += prevIdentity.email; prevBcc += prevIdentity.email;
if (prevIdentity.bccOthers) if (prevIdentity.bccOthers)
@ -2409,6 +2415,8 @@ function LoadIdentity(startup)
var newReplyTo = gCurrentIdentity.replyTo; var newReplyTo = gCurrentIdentity.replyTo;
var newBcc = ""; var newBcc = "";
var newReceipt =
gCurrentIdentity.getBoolAttribute("request_return_receipt_on");
if (gCurrentIdentity.bccSelf) if (gCurrentIdentity.bccSelf)
newBcc += gCurrentIdentity.email; newBcc += gCurrentIdentity.email;
if (gCurrentIdentity.bccOthers) if (gCurrentIdentity.bccOthers)
@ -2421,6 +2429,15 @@ function LoadIdentity(startup)
var needToCleanUp = false; var needToCleanUp = false;
var msgCompFields = gMsgCompose.compFields; var msgCompFields = gMsgCompose.compFields;
if (!gReceiptOptionChanged &&
prevReceipt == msgCompFields.returnReceipt &&
prevReceipt != newReceipt)
{
msgCompFields.returnReceipt = newReceipt;
document.getElementById("returnReceiptMenu").setAttribute('checked',msgCompFields.returnReceipt);
}
if (newReplyTo != prevReplyTo) if (newReplyTo != prevReplyTo)
{ {
needToCleanUp = true; needToCleanUp = true;