add: if (!gAttachVCardOptionChanged && prevAttachVCard == msgCompFields.attachVCard && prevAttachVCard != newAttachVCard) { msgCompFields.attachVCard = newAttachVCard; document.getElementById("cmd_attachVCard").setAttribute('checked',msgCompFields.attachVCard); } 
context: function LoadIdentity(startup){    var identityElement = document.getElementById("msgIdentity");    var prevIdentity = gCurrentIdentity;        if (identityElement) {        var idKey = identityElement.value;        gCurrentIdentity = gAccountManager.getIdentity(idKey);        // set the  account name on the menu list value.        var accountName = identityElement.selectedItem.getAttribute('accountname');        identityElement.setAttribute('accountname', accountName);        if (!startup && prevIdentity && idKey != prevIdentity.key)        {          var prefstring = "mail.identity." + prevIdentity.key;          RemoveDirectoryServerObserver(prefstring);          var prevReplyTo = prevIdentity.replyTo;          var prevBcc = "";          var prevReceipt = prevIdentity.requestReturnReceipt;          if (prevIdentity.doBcc)            prevBcc += prevIdentity.doBccList;          var newReplyTo = gCurrentIdentity.replyTo;          var newBcc = "";          var newReceipt = gCurrentIdentity.requestReturnReceipt;          if (gCurrentIdentity.doBcc)            newBcc += gCurrentIdentity.doBccList;                    var needToCleanUp = false;          var msgCompFields = gMsgCompose.compFields;          if (!gReceiptOptionChanged &&              prevReceipt == msgCompFields.returnReceipt &&              prevReceipt != newReceipt)          {            msgCompFields.returnReceipt = newReceipt;            document.getElementById("returnReceiptMenu").setAttribute('checked',msgCompFields.returnReceipt);          }          if (newReplyTo != prevReplyTo)          {            needToCleanUp = true;            if (prevReplyTo != "")              awRemoveRecipients(msgCompFields, "addr_reply", prevReplyTo);            if (newReplyTo != "")              awAddRecipients(msgCompFields, "addr_reply", newReplyTo);          }          if (newBcc != prevBcc)          {            needToCleanUp = true;            if (prevBcc != "")              awRemoveRecipients(msgCompFields, "addr_bcc", prevBcc);            if (newBcc != "")              awAddRecipients(msgCompFields, "addr_bcc", newBcc);          }          if (needToCleanUp)            awCleanupRows();          try {            gMsgCompose.SetSignature(gCurrentIdentity);          } catch (ex) { dump("### Cannot set the signature: " + ex + "\n");}          var event = document.createEvent('Events');          event.initEvent('compose-from-changed', false, true);          document.getElementById("msgcomposeWindow").dispatchEvent(event);        }      AddDirectoryServerObserver(false);      if (!startup) {          if (!gAutocompleteSession)            gAutocompleteSession = Components.classes["@mozilla.org/autocompleteSession;1?type=addrbook"].getService(Components.interfaces.nsIAbAutoCompleteSession);          if (gAutocompleteSession)            setDomainName();          try {              setupLdapAutocompleteSession();          } catch (ex) {              // catch the exception and ignore it, so that if LDAP setup               // fails, the entire compose window doesn't end up horked          }      }    }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/70d7cb685c01273409b91e5dcc79890e17d8108e/MsgComposeCommands.js/buggy/mail/components/compose/content/MsgComposeCommands.js