Changeset 7a31a1


Ignore:
Timestamp:
Aug 30, 2012, 9:24:20 PM (7 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
07105b
Parents:
d97e9a
Message:

fix for signatureswitch extension usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • modules/plugins/signatureSwitch.js

    rd97e9a r7a31a1  
    3131let Log = setupLogging("virtualIdentity.signatureSwitch");
    3232
    33 currentWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
    34   .getService(Ci.nsIWindowMediator)
    35   .getMostRecentWindow(null);
    36 
    3733function signatureSwitch(existingIdentity) {
    3834  if (!signatureSwitchInstalled) return;
     
    4137  try { setSecuritySettings(1); enigSetMenuSettings(''); } catch(vErr) { };
    4238 
     39  let signatureWindow = Cc["@mozilla.org/appshell/window-mediator;1"]
     40      .getService(Ci.nsIWindowMediator)
     41      .getMostRecentWindow(null);
     42
    4343  if (!existingIdentity) {
    4444    Log.debug("signatureSwitch hide/remove signatures");
    4545   
    4646    // code to hide the text signature
    47     if (vIprefs.get("hide_signature") && ss_signature.length == 0) {
     47    if (vIprefs.get("hide_signature") && signatureWindow.ss_signature.length == 0) {
    4848      Log.debug("hide text/html signature");
    49       ss_main.signatureSwitch()
     49      signatureWindow.ss_main.signatureSwitch()
    5050    }
    5151   
    5252    // code to hide the sMime signature
    5353    if (vIprefs.get("hide_sMime_messageSignature")) {
    54       var element = currentWindow.document.getElementById("menu_securitySign1");
     54      var element = signatureWindow.document.getElementById("menu_securitySign1");
    5555      if (element && element.getAttribute("checked") == "true") {
    5656        Log.debug("signatureSwitch hide_sMime_messageSignature with doCommand");
     
    6161    // code to hide the openGPG signature
    6262    if (vIprefs.get("hide_openPGP_messageSignature")) {
    63       var element = currentWindow.document.getElementById("enigmail_signed_send");
     63      var element = signatureWindow.document.getElementById("enigmail_signed_send");
    6464      if (element && element.getAttribute("checked") == "true") {
    6565        var skipChangeGPGsign = false;
     
    8383    Log.debug("signatureSwitch restore signature");
    8484    // code to show the text signature
    85     if (ss_signature.length > 0) {
     85    if (signatureWindow.ss_signature.length > 0) {
    8686      Log.debug("show text/html signature");
    87       ss_main.signatureSwitch()
     87      signatureWindow.ss_main.signatureSwitch()
    8888    }
    8989    // sMime and openGPG signature will not be re-added automatically
Note: See TracChangeset for help on using the changeset viewer.