Changeset ecb992


Ignore:
Timestamp:
Nov 10, 2014, 2:49:17 PM (5 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
803449
Parents:
7204cb
Message:

changes required for enigmail >=1.7

Files:
15 edited

Legend:

Unmodified
Added
Removed
  • content/prefDialog/vI_prefDialog.js

    r7204cb recb992  
    111111          "VIdent_identity.copySMIMESettings",
    112112          "VIdent_identity.copyAttachVCardSettings",
     113          "VIdent_identity.copyNewEnigmailSettings",
    113114          "VIdent_identity.smart_reply",
    114115          "VIdent_identity.smart_detectByReceivedHeader",
     
    365366            document.getElementById("openPGPencryption").removeAttribute("hidden");
    366367            document.getElementById("VIdent_identity.hide_openPGP_messageSignature").removeAttribute("hidden");
     368            document.getElementById("VIdent_identity.copyNewEnigmailSettings").removeAttribute("hidden");
    367369          }
    368370        });
  • content/prefDialog/vI_prefDialog.xul

    r7204cb recb992  
    414414                <caption label="&vI_prefDialog.sending.Folder.caption;"/>
    415415                <description class="widthXX">&vI_prefDialog.sending.Folder.desc;</description>
     416        <checkbox id="VIdent_identity.copyNewEnigmailSettings" label="&vI_prefDialog.sending.Folder.Enigmail.label;"
     417          prefstring="copyNewEnigmailSettings" hidden="true"/>
    416418                <checkbox id="VIdent_identity.copySMIMESettings" label="&vI_prefDialog.sending.Folder.SMIME.label;"
    417419                    prefstring="copySMIMESettings"/>
  • content/v_identity.js

    r7204cb recb992  
    7777          Log.debug("StateListener reports ComposeProcessDone");
    7878          vI.vIaccount_removeUsedVIAccount();
    79           main.Cleanup(); // not really required, parallel handled by main.close
    8079          vI.storage.clean();
    8180        },
     
    8382          Log.debug("SaveInFolderDone");
    8483          vI.vIaccount_removeUsedVIAccount();
    85           main.Cleanup();
    8684          vI.storage.clean();
    8785        }
     
    160158            main.replacement_functions.GenericSendMessageInProgress = false;
    161159            main.original_functions.GenericSendMessage(msgType);
    162           } else main.Cleanup();
     160          }
     161          // sending or saving is done (or skipped), if aborted we must restore interface settings for further use
     162          main.removeVirtualIdentityFromMsgIdentityMenu();
     163          // restore enigmail 'current' identity - has been changed while trying to sent
     164          if (typeof Enigmail != 'undefined') Enigmail.msg.identity = getCurrentIdentity();
     165
    163166          main.replacement_functions.GenericSendMessageInProgress = false;
    164167          //            Log.debug("original_functions.GenericSendMessage done");
     
    176179        window.removeEventListener('compose-window-close', main.close, true);
    177180        Log.debug("end. remove Account if there.")
    178         main.Cleanup();
    179181        vI.storage.clean();
    180182      },
     
    255257
    256258      close: function () {
    257         main.Cleanup();
    258259        vI.storage.clean();
    259260      },
     
    373374
    374375      prepareAccount: function () {
    375         main.Cleanup(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped)
     376        main.removeVirtualIdentityFromMsgIdentityMenu(); // just to be sure that nothing is left (maybe last time sending was irregularily stopped)
    376377        vI.vIaccount_createAccount(document.getElementById("virtualIdentityExtension_msgIdentityClone").identityData,
    377378          main.accountManager.getIdentity(main.elements.Obj_MsgIdentity.value));
    378379        main.addVirtualIdentityToMsgIdentityMenu();
    379       },
    380 
    381       Cleanup: function () {
    382         main.removeVirtualIdentityFromMsgIdentityMenu();
    383         //      vI.vIaccount_removeUsedVIAccount();
    384380      },
    385381
  • defaults/preferences/preferences.js

    r7204cb recb992  
    99pref("extensions.virtualIdentity.copySMIMESettings", false);
    1010pref("extensions.virtualIdentity.copyAttachVCardSettings", false);
     11pref("extensions.virtualIdentity.copyNewEnigmailSettings", true);
    1112pref("extensions.virtualIdentity.show_smtp", false);
    1213pref("extensions.virtualIdentity.show_status", true);
  • locale/cs-CZ/vI_prefDialog.dtd

    r7204cb recb992  
    112112<!ENTITY vI_prefDialog.sending.Folder.caption "atributy pro zkopírování">
    113113<!ENTITY vI_prefDialog.sending.Folder.desc "kopírovat následující vlastnosti z předchozí identity:">
     114<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings"> <!-- translate -->
    114115<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "Nastavení S/MIME">
    115116<!ENTITY vI_prefDialog.sending.Folder.VCard.label "přílohy vCard">
  • locale/de-DE/vI_prefDialog.dtd

    r7204cb recb992  
    112112<!ENTITY vI_prefDialog.sending.Folder.caption "zu Kopierende Eigenschaften">
    113113<!ENTITY vI_prefDialog.sending.Folder.desc "folgende Einstellungen der zugrunde liegenden IdentitÀt kopieren:">
     114<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail Einstellungen">
    114115<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "S/MIME Sicherheitseinstellungen">
    115116<!ENTITY vI_prefDialog.sending.Folder.VCard.label "anzuhÀngende Visitenkarten">
  • locale/en-US/vI_prefDialog.dtd

    r7204cb recb992  
    111111<!ENTITY vI_prefDialog.sending.Folder.caption "attributes to copy">
    112112<!ENTITY vI_prefDialog.sending.Folder.desc "copy following Attributes from underlying base Identity:">
     113<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings">
    113114<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "S/MIME security settings">
    114115<!ENTITY vI_prefDialog.sending.Folder.VCard.label "vCard attachments">
  • locale/es-ES/vI_prefDialog.dtd

    r7204cb recb992  
    112112<!ENTITY vI_prefDialog.sending.Folder.caption "atributos a copiar">
    113113<!ENTITY vI_prefDialog.sending.Folder.desc "copiar los siguientes atributos de la identidad correspondiente:">
     114<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings"> <!-- translate -->
    114115<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "Opciones de seguridad S/MIME">
    115116<!ENTITY vI_prefDialog.sending.Folder.VCard.label "adjuntos vCard">
  • locale/fr/vI_prefDialog.dtd

    r7204cb recb992  
    112112<!ENTITY vI_prefDialog.sending.Folder.caption "attributs à copier">
    113113<!ENTITY vI_prefDialog.sending.Folder.desc "copier les attributs suivants à partir de l'ancienne identité :">
     114<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings"> <!-- translate -->
    114115<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "paramÚtres de sécurité S/MIME">
    115116<!ENTITY vI_prefDialog.sending.Folder.VCard.label "piÚces jointes vCard">
  • locale/nl/vI_prefDialog.dtd

    r7204cb recb992  
    112112<!ENTITY vI_prefDialog.sending.Folder.caption "Te kopiëren eigenschappen">
    113113<!ENTITY vI_prefDialog.sending.Folder.desc "De volgende eigenschappen van de vorige identiteit overnemen:">
     114<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings"> <!-- translate -->
    114115<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "S/MIME-beveiligingsinstellingen">
    115116<!ENTITY vI_prefDialog.sending.Folder.VCard.label "vCard-bijlagen">
  • locale/ru-RU/vI_prefDialog.dtd

    r7204cb recb992  
    216216<!ENTITY vI_prefDialog.sending.Folder.caption "АтрОбуты сППбщеМОй Ўля кПпОрПваМОя">
    217217<!ENTITY vI_prefDialog.sending.Folder.desc "КПпОрПвать слеЎующОе атрОбуты сППбщеМОй Оз учетМПй запОсО:">
     218<!ENTITY vI_prefDialog.sending.Folder.Enigmail.label "OpenPGP / Enigmail settings"> <!-- translate -->
    218219<!ENTITY vI_prefDialog.sending.Folder.SMIME.label "S/MIME МастрПйкО безПпасМПстО">
    219220<!ENTITY vI_prefDialog.sending.Folder.VCard.label "vCard влПжеМОя">
  • modules/identityDataExtras/PGPEncryption.js

    r7204cb recb992  
    3333Cu.import("resource://v_identity/vI_log.js");
    3434let Log = setupLogging("virtualIdentity.identityDataExtras.PGPEncryption");
     35let vc = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
    3536
    3637function identityDataExtrasObject_PGPEncryption(currentWindow) {
     
    3839  this.field = "PGPEnc"; // description of the option
    3940  this.option = "storageExtras_openPGP_messageEncryption"; // option string to get preference settings
    40   this.elementID_msgCompose = "enigmail_encrypted_send";
    41   this.updateFunction_msgCompose = function () {
    42     (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
    43   };
     41  this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     42
     43  // enigmail preferences have changed into 1.7 - check for enigmail version
     44  if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     45    this.elementID_msgCompose = "enigmail_encrypted_send";
     46    this.updateFunction_msgCompose = function () {
     47      (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     48    };
     49  } else {
     50    this.setValueToEnvironment_msgCompose = this.__new_setValueToEnvironment_msgCompose;
     51    this.getValueFromEnvironment_msgCompose = this.__new_getValueFromEnvironment_msgCompose;
     52  }
    4453}
    4554identityDataExtrasObject_PGPEncryption.prototype = {
     
    4756
    4857  readIdentityValue: function (identity) {
    49     if (this.active) this.value = (identity.getIntAttribute('defaultEncryptionPolicy') > 0) ? "true" : "false";
     58    if (this.enigmail_active && this.active) this.value = (identity.getIntAttribute('defaultEncryptionPolicy') > 0) ? "true" : "false";
     59  },
     60
     61  __new_setValueToEnvironment_msgCompose: function () {
     62    if (!this.enigmail_active || !this.active || (this.value == null))
     63      return;
     64
     65    if (this.value == "true") {
     66      this.currentWindow.Enigmail.msg.setFinalSendMode("final-encryptYes");
     67    } else {
     68      this.currentWindow.Enigmail.msg.setFinalSendMode("final-encryptNo");
     69    }
     70  },
     71
     72  __new_getValueFromEnvironment_msgCompose: function () {
     73    if (this.enigmail_active && this.active) {
     74      this.value = (this.currentWindow.Enigmail.msg.statusEncrypted) ? "true" : "false";
     75    }
    5076  }
    5177}
  • modules/identityDataExtras/PGPMIME.js

    r7204cb recb992  
    3333Cu.import("resource://v_identity/vI_log.js");
    3434let Log = setupLogging("virtualIdentity.identityDataExtras.PGPMIME");
     35let vc = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
    3536
    3637function identityDataExtrasObject_PGPMIME(currentWindow) {
     
    3839  this.field = "PGPMIME"; // description of the option
    3940  this.option = "storageExtras_openPGP_PGPMIME"; // option string to get preference settings
    40   this.elementID_msgCompose = "enigmail_sendPGPMime";
    41   this.updateFunction_msgCompose = function () {
    42     (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
    43   };
     41  this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     42
     43  // enigmail preferences have changed into 1.7 - check for enigmail version
     44  if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     45    this.elementID_msgCompose = "enigmail_sendPGPMime";
     46    this.updateFunction_msgCompose = function () {
     47      (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     48    };
     49  } else {
     50    this.setValueToEnvironment_msgCompose = this.__new_setValueToEnvironment_msgCompose;
     51    this.getValueFromEnvironment_msgCompose = this.__new_getValueFromEnvironment_msgCompose;
     52  }
    4453}
    4554identityDataExtrasObject_PGPMIME.prototype = {
     
    4756
    4857  readIdentityValue: function (identity) {
    49     if (this.active) this.value = (identity.getBoolAttribute('pgpMimeMode')) ? "true" : "false";
     58    if (this.enigmail_active && this.active) this.value = (identity.getBoolAttribute('pgpMimeMode')) ? "true" : "false";
     59  },
     60
     61  __new_setValueToEnvironment_msgCompose: function () {
     62    if (!this.enigmail_active || !this.active || (this.value == null))
     63      return;
     64
     65    if (this.value == "true") {
     66      this.currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeYes");
     67    } else {
     68      this.currentWindow.Enigmail.msg.setFinalSendMode("final-pgpmimeNo");
     69    }
     70  },
     71
     72  __new_getValueFromEnvironment_msgCompose: function () {
     73    if (this.enigmail_active && this.active) {
     74      this.value = (this.currentWindow.Enigmail.msg.statusPGPMime) ? "true" : "false";
     75    }
    5076  }
    5177}
  • modules/identityDataExtras/PGPSignature.js

    r7204cb recb992  
    3333Cu.import("resource://v_identity/vI_log.js");
    3434let Log = setupLogging("virtualIdentity.identityDataExtras.PGPSignature");
     35let vc = Cc["@mozilla.org/xpcom/version-comparator;1"].getService(Ci.nsIVersionComparator);
    3536
    3637function identityDataExtrasObject_PGPSignature(currentWindow) {
     
    3839  this.field = "PGPSig"; // description of the option
    3940  this.option = "storageExtras_openPGP_messageSignature"; // option string to get preference settings
    40   this.elementID_msgCompose = "enigmail_signed_send";
    41   this.updateFunction_msgCompose = function () {
    42     (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
    43   };
     41  this.enigmail_active = (typeof this.currentWindow.Enigmail != 'undefined');
     42
     43  // enigmail preferences have changed into 1.7 - check for enigmail version
     44  if (this.enigmail_active && vc.compare(this.currentWindow.EnigmailCommon.getVersion(), "1.7") < 0) {
     45    this.elementID_msgCompose = "enigmail_signed_send";
     46    this.updateFunction_msgCompose = function () {
     47      (typeof (this.currentWindow.Enigmail.msg.setMenuSettings) == 'function') ? this.currentWindow.Enigmail.msg.setMenuSettings(''): null
     48    };
     49  } else {
     50    this.setValueToEnvironment_msgCompose = this.__new_setValueToEnvironment_msgCompose;
     51    this.getValueFromEnvironment_msgCompose = this.__new_getValueFromEnvironment_msgCompose;
     52  }
    4453}
    4554identityDataExtrasObject_PGPSignature.prototype = {
     
    4756
    4857  readIdentityValue: function (identity) {
    49     if (this.active) {
     58    if (this.enigmail_active && this.active) {
    5059      if (identity.getIntAttribute('defaultEncryptionPolicy') > 0)
    5160        this.value = (identity.getBoolAttribute('pgpSignEncrypted')) ? "true" : "false";
     
    5362        this.value = (identity.getBoolAttribute('pgpSignPlain')) ? "true" : "false";
    5463    }
     64  },
     65
     66  __new_setValueToEnvironment_msgCompose: function () {
     67    if (!this.enigmail_active || !this.active || (this.value == null))
     68      return;
     69
     70    if (this.value == "true") {
     71      this.currentWindow.Enigmail.msg.setFinalSendMode("final-signYes");
     72    } else {
     73      this.currentWindow.Enigmail.msg.setFinalSendMode("final-signNo");
     74    }
     75  },
     76
     77  __new_getValueFromEnvironment_msgCompose: function () {
     78    if (this.enigmail_active && this.active) {
     79      this.value = (this.currentWindow.Enigmail.msg.statusSigned) ? "true" : "false";
     80    }
    5581  }
    5682}
  • modules/vI_account.js

    r7204cb recb992  
    126126
    127127  _copyBoolAttribute: function (name) {
     128    Log.debug("copy attribute '" + name + "', value='" + account._baseIdentity.getBoolAttribute(name) + "'");
    128129    account._account.defaultIdentity.setBoolAttribute(name,
    129130      account._baseIdentity.getBoolAttribute(name));
     
    131132
    132133  _copyIntAttribute: function (name) {
     134    Log.debug("copy attribute '" + name + "', value='" + account._baseIdentity.getIntAttribute(name) + "'");
    133135    account._account.defaultIdentity.setIntAttribute(name,
    134136      account._baseIdentity.getIntAttribute(name));
     
    136138
    137139  _copyCharAttribute: function (name) {
     140    Log.debug("copy attribute '" + name + "', value='" + account._baseIdentity.getCharAttribute(name) + "'");
    138141    account._account.defaultIdentity.setCharAttribute(name,
    139142      account._baseIdentity.getCharAttribute(name));
     
    141144
    142145  _copyUnicharAttribute: function (name) {
     146    Log.debug("copy attribute '" + name + "', value='" + account._baseIdentity.getUnicharAttribute(name) + "'");
    143147    account._account.defaultIdentity.setUnicharAttribute(name,
    144148      account._baseIdentity.getUnicharAttribute(name));
     
    153157      account._copyIntAttribute("encryptionpolicy");
    154158    }
    155     /*      seems not required, encryption happens before Virtual Identity account is created
    156             if (vIprefs.get("copyEnigmailSettings")) {
    157                 // pgp/enigmail settings
    158                 Log.debug("copy PGP settings")
    159                 account._copyBoolAttribute("pgpSignEncrypted");
    160                 account._copyBoolAttribute("pgpSignPlain");
    161                 account._copyBoolAttribute("enablePgp");
    162                 account._copyIntAttribute("pgpKeyMode");
    163                 account._copyCharAttribute("pgpkeyId");
    164                 account._copyIntAttribute("openPgpHeaderMode");
    165                 account._copyCharAttribute("openPgpUrlName");
    166            
    167                 account._copyIntAttribute("defaultEncryptionPolicy");
    168             }   */
     159    if (vIprefs.get("copyNewEnigmailSettings")) {
     160      // pgp/enigmail settings
     161      Log.debug("copy PGP settings")
     162      account._copyBoolAttribute("enablePgp");
     163      account._copyIntAttribute("pgpKeyMode");
     164      account._copyCharAttribute("pgpkeyId");
     165      account._copyIntAttribute("defaultSigningPolicy");
     166      account._copyIntAttribute("defaultEncryptionPolicy");
     167      account._copyBoolAttribute("pgpMimeMode");
     168      account._copyBoolAttribute("pgpSignEncrypted");
     169      account._copyBoolAttribute("pgpSignPlain");
     170      account._copyBoolAttribute("autoEncryptDrafts");
     171      account._copyIntAttribute("openPgpHeaderMode");
     172      account._copyCharAttribute("openPgpUrlName");
     173      account._copyBoolAttribute("attachPgpKey");
     174    }
    169175    if (vIprefs.get("copyAttachVCardSettings")) {
    170176      // attach vcard
Note: See TracChangeset for help on using the changeset viewer.