diff --git a/chrome/content/modules/pEp.js b/chrome/content/modules/pEp.js index 385da6a..668f5de 100644 --- a/chrome/content/modules/pEp.js +++ b/chrome/content/modules/pEp.js @@ -19,10 +19,7 @@ const EXPORTED_SYMBOLS = ["pEp"]; const DIR_INCOMING = 0; const DIR_OUTGOING = 1; -// refer to `typedef enum _PEP_enc_format` in `message.h` in -// the engine code for details about these values const ENC_FORMAT_NONE = 0; -const ENC_FORMAT_S_MIME = 2; const ENC_FORMAT_PGP_MIME = 3; const ENC_FORMAT_PEP = 4; const PEP_PREFIX = "pEp-"; @@ -235,13 +232,13 @@ class pEp { return obj && JSON.parse(JSON.stringify(obj)); } let clone = new pEp.Message(source.id, - source.shortmsg, - source.longmsg, - deepCopy(source.from), - deepCopy(source.to), - source.dir, - source.enc_format, - deepCopy(source.attachments), + source.shortmsg, + source.longmsg, + deepCopy(source.from), + deepCopy(source.to), + source.dir, + source.enc_format, + deepCopy(source.attachments), deepCopy(source.opt_fields)); source.cc && clone.setCc(source.cc); source.bcc && clone.setBcc(source.bcc); @@ -433,13 +430,6 @@ pEp.Message = class { let met = (this.enc_format === 0) ? this.fromUnencrypted.bind(this) : this.fromEncrypted.bind(this); return met(atob, boundary); } - - isEncrypted() { - const formats = [ENC_FORMAT_S_MIME, - ENC_FORMAT_PGP_MIME, - ENC_FORMAT_PEP]; - return formats.filter(format => format === this.enc_format).length > 0; - } }; diff --git a/chrome/content/options.js b/chrome/content/options.js index d84c966..ce167f9 100644 --- a/chrome/content/options.js +++ b/chrome/content/options.js @@ -4,7 +4,6 @@ Preferences.addAll([ { id: "extensions.p4tb.warnUnencrypted", type: "bool" }, { id: "extensions.p4tb.unprotectedSubjects", type: "bool" }, { id: "extensions.p4tb.storeProtectedOptions", type: "bool" }, - { id: "extensions.p4tb.securityLossWarning", type: "bool" }, { id: "extensions.p4tb.pEpSync", type: "bool" }, // examples with different types //{ id: "extensions.nameOfAddon.pref2", type: "string" }, @@ -20,9 +19,13 @@ window.addEventListener('load', function () { document.getElementById('storeAllSecurely').checked = Prefs.isStoreAllSecurely(); document.getElementById('warnUnencrypted').checked = Prefs.isWarnUnencrypted(); let acceptButton = document.querySelector('button#accept'); + let cancelButton = document.querySelector('button#cancel'); acceptButton.addEventListener('click', function () { Prefs.setIsStoreAllSecurely(document.getElementById('storeAllSecurely').checked); Prefs.setWarnUnencrypted(document.getElementById('warnUnencrypted').checked); window.close(); }); + cancelButton.addEventListener('click', function () { + window.close(); + }); }); diff --git a/chrome/content/options.xul b/chrome/content/options.xul index 6701801..fcf83ef 100644 --- a/chrome/content/options.xul +++ b/chrome/content/options.xul @@ -36,11 +36,10 @@ - - + Cancel diff --git a/chrome/content/pEpMimeEncrypt.js b/chrome/content/pEpMimeEncrypt.js index acadb00..1b37d85 100644 --- a/chrome/content/pEpMimeEncrypt.js +++ b/chrome/content/pEpMimeEncrypt.js @@ -4,7 +4,7 @@ "use strict"; -const { jsmime } = ChromeUtils.import("resource:///modules/jsmime.jsm"); +const jsmime = ChromeUtils.import("resource:///modules/jsmime.jsm").jsmime; const {classes: Cc, results: Cr, interfaces: Ci} = Components; const maxBufferLen = 102400; @@ -25,9 +25,7 @@ function isMessageUriInPgpMime() { return ("messageURI" in gPgpMimeObj); } -function PgpMimeEncrypt(originalMessage, sMimeSecurityInfo) { - this.originalMessage = originalMessage; - +function PgpMimeEncrypt(sMimeSecurityInfo) { console.log("pEp PgpMimeEncrypt CONSTRUCTOR"); this.wrappedJSObject = this; @@ -382,6 +380,7 @@ PgpMimeEncrypt.prototype = { let resultMessage = this.pEp.cloneMessage(resultObj); this.outQueue = this.pEpController.mimeFromMessage(resultMessage); } else if (requireEncryption) { + // Open Dialog and ask user to send mail unencrypted throw Cr.NS_ERROR_FAILURE; } diff --git a/chrome/content/pepmsghdrview.js b/chrome/content/pepmsghdrview.js index d579769..0f7047b 100644 --- a/chrome/content/pepmsghdrview.js +++ b/chrome/content/pepmsghdrview.js @@ -122,7 +122,7 @@ var ColumnOverlay = { var pEpHdrView = { - init: function (window) { + init: function () { console.debug("pEpHdrView: init()", this, window); this.onLoadListener(); pEpController.addFactory();