Browse Source

More linting (max-len) and other clean-up.

1.1.101
Jorg Knobloch 2 years ago
parent
commit
d143c8d2e1
5 changed files with 7 additions and 26 deletions
  1. +1
    -2
      .eslintrc.json
  2. +2
    -1
      chrome/content/modules/pEp.js
  3. +1
    -23
      chrome/content/modules/pEpServer.js
  4. +2
    -0
      chrome/content/pEpMimeDecrypt.js
  5. +1
    -0
      chrome/experiments.js

+ 1
- 2
.eslintrc.json View File

@ -28,7 +28,7 @@
"max-len": [
"error",
{
"code": 120,
"code": 130,
"tabWidth": 4
}
],
@ -61,7 +61,6 @@
"comment will need to look at all the following one-by-one": "off",
"eqeqeq": "off",
"indent": "off",
"max-len": "off",
"no-unused-vars": "off"
}
}

+ 2
- 1
chrome/content/modules/pEp.js View File

@ -274,7 +274,8 @@ pEp.Attachment = class {
pEp.Message = class {
// constructor fields that have no default value are required for
// the engine to correctly process the message
constructor(id, short, long, from, to = [], dir = DIR_OUTGOING, enc_format = ENC_FORMAT_PEP, attachmentsArray = [], optFieldsArray = [], formatted_long = undefined) {
constructor(id, short, long, from, to = [], dir = DIR_OUTGOING, enc_format = ENC_FORMAT_PEP,
attachmentsArray = [], optFieldsArray = [], formatted_long = undefined) {
if (typeof to === "string") to = [to];
this.dir = dir;


+ 1
- 23
chrome/content/modules/pEpServer.js View File

@ -2,14 +2,8 @@ const EXPORTED_SYMBOLS = ["pEpServer"];
let pepServerInstance;
const MIN_REQUIRED_VERSION = "0.14.0";
const MAX_RETRY_ATTEMPTS = 2;
const SERVER_TYPE_CALL_FUNC = "callFunction";
const PEP_WRONG_SEC_TOKEN_CODE = -32600;
const PEP_RESPONSE_OK = 0;
const PEP_RESPONSE_UNENCRYPTED = 1024;
const PEP_RESPONSE_DECRYPTED = 1026;
class pEpServer {
constructor(log, connectionInfoDetector, xhrQueue) {
if (pepServerInstance) return pepServerInstance;
@ -103,23 +97,7 @@ class pEpServer {
}
getConnectionAddress() {
let connectionObject = this.connectionInfo;
if (!this.connectionInfo) {
connectionObject = {
// provide a default (that should fail)
address: "127.0.0.1",
port: 0,
path: "/none/",
pathQueryRef: "/none/",
security_token: "",
};
}
return `http://${connectionObject.address}:${connectionObject.port}${"path" in connectionObject ? connectionObject.path : connectionObject.pathQueryRef}`;
}
resetConnectionInfo() {
this.connectionInfo = null;
return `http://${this.connectionInfo.address}:${this.connectionInfo.port}${this.connectionInfo.path}`;
}
}


+ 2
- 0
chrome/content/pEpMimeDecrypt.js View File

@ -138,6 +138,7 @@ MimeDecrypt.prototype = {
&& !decryptedMessage.longmsg && decryptedMessage.longmsg_formatted) {
const parserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils);
// Flags taken from here:
// eslint-disable-next-line max-len
// https://searchfox.org/comm-central/rev/0c6472bec30280a0648e5101ffacaf72907e4cc2/mailnews/mime/src/mimethpl.cpp#78
const flags = Ci.nsIDocumentEncoder.OutputFormatted
| Ci.nsIDocumentEncoder.OutputWrap
@ -171,6 +172,7 @@ MimeDecrypt.prototype = {
// `onStopRequest()` must by synchronous.
// `synchronise` is similar to `sync` defined in
// eslint-disable-next-line max-len
// https://searchfox.org/comm-central/rev/0c6472bec30280a0648e5101ffacaf72907e4cc2/mail/extensions/openpgp/content/modules/cryptoAPI/interface.js#32
function synchronise(promise) {
const inspector = Cc["@mozilla.org/jsinspector;1"].createInstance(Ci.nsIJSInspector);


+ 1
- 0
chrome/experiments.js View File

@ -49,6 +49,7 @@ function setPrefs(prefBranch) {
// Implements the functions defined in the experiments section of schema.json.
// eslint-disable-next-line vars-on-top
var pEp4Tb = class extends ExtensionCommon.ExtensionAPI {
// eslint-disable-next-line max-len
// Idea from https://searchfox.org/mozilla-central/rev/72e3388f74458d369af4f6cdbaeaacb719523b8c/browser/extensions/formautofill/api.js#95
// Investigation by Mark Banner.
onStartup() {


Loading…
Cancel
Save