Browse Source

Linting: Adjust operator-linebreak rule.

1.1.101
Jorg Knobloch 2 years ago
parent
commit
fe5fa54e7d
5 changed files with 25 additions and 21 deletions
  1. +5
    -0
      .eslintrc.json
  2. +7
    -7
      chrome/content/pEpForThunderbird.js
  3. +2
    -3
      chrome/content/pEpMimeDecrypt.js
  4. +9
    -9
      chrome/content/pepmessengercompose.js
  5. +2
    -2
      chrome/content/pepmsghdrview.js

+ 5
- 0
.eslintrc.json View File

@ -32,6 +32,11 @@
"quotes": [
"warn", "double"
],
"operator-linebreak": [
2, "after", {
"overrides": { "?": "before", ":": "before" }
}
],
"comment will leave the following": "off",
"array-callback-return": "off",
"camelcase": "off",


+ 7
- 7
chrome/content/pEpForThunderbird.js View File

@ -232,13 +232,13 @@ class pEpForThunderbird extends pEp {
// 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
| Ci.nsIDocumentEncoder.OutputFormatFlowed
| Ci.nsIDocumentEncoder.OutputLFLineBreak
| Ci.nsIDocumentEncoder.OutputNoScriptContent
| Ci.nsIDocumentEncoder.OutputNoFramesContent
| Ci.nsIDocumentEncoder.OutputBodyOnly;
const flags = Ci.nsIDocumentEncoder.OutputFormatted |
Ci.nsIDocumentEncoder.OutputWrap |
Ci.nsIDocumentEncoder.OutputFormatFlowed |
Ci.nsIDocumentEncoder.OutputLFLineBreak |
Ci.nsIDocumentEncoder.OutputNoScriptContent |
Ci.nsIDocumentEncoder.OutputNoFramesContent |
Ci.nsIDocumentEncoder.OutputBodyOnly;
this.currentMessage.longmsg = parserUtils.convertToPlainText(this.currentMessage.longmsg_formatted, flags, 0);
}
} else {


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

@ -120,9 +120,8 @@ MimeDecrypt.prototype = {
if (!this.uri && !decoded.includes("multipart/")) {
/* eslint-disable prefer-template */
decoded = decoded.replace("MIME-Version: 1.0",
"MIME-Version: 1.0\r\n"
+ "Content-Type: multipart/mixed; boundary=evilhack\r\n\r\n"
+ "--evilhack\r\nContent-Disposition: inline");
"MIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=evilhack\r\n\r\n" +
"--evilhack\r\nContent-Disposition: inline");
decoded += "--evilhack--\r\n";
/* eslint-enable prefer-template */
}


+ 9
- 9
chrome/content/pepmessengercompose.js View File

@ -120,8 +120,8 @@ var pEpComposer = {
// We are here for the first time, so let's see whether we should encrypt.
// We always encrypt if the original was private, see P4TB-75.
this.shouldEncrypt = TbHelper.encryptForIdentity(currentIdentity)
|| this.isOriginallyEncrypted;
this.shouldEncrypt = TbHelper.encryptForIdentity(currentIdentity) ||
this.isOriginallyEncrypted;
// The user can also disable protection, even though they should encrypt.
// When the window comes up for the first time, nothing is disabled yet.
@ -306,16 +306,16 @@ var pEpComposer = {
const msgcomposeWindow = document.getElementById("msgcomposeWindow");
const sendMsgType = msgcomposeWindow.getAttribute("msgtype");
if (sendMsgType == Ci.nsIMsgCompDeliverMode.SaveAsDraft
|| sendMsgType == Ci.nsIMsgCompDeliverMode.SaveAsTemplate
|| sendMsgType == Ci.nsIMsgCompDeliverMode.AutoSaveAsDraft) {
if (sendMsgType == Ci.nsIMsgCompDeliverMode.SaveAsDraft ||
sendMsgType == Ci.nsIMsgCompDeliverMode.SaveAsTemplate ||
sendMsgType == Ci.nsIMsgCompDeliverMode.AutoSaveAsDraft) {
// Check whether the account of the identity requires secure storage.
isDraftOrTemplate = true;
if (!TbHelper.encryptDraftOrTemplateForIdentity(TbAbstraction.getCurrentIdentity(), sendMsgType)) return;
}
if (Services.prefs.getBoolPref("extensions.pEp.warnUnencrypted", true)
&& (this.isOriginallyEncrypted && !isPrivate(this.rating))) {
if (Services.prefs.getBoolPref("extensions.pEp.warnUnencrypted", true) &&
(this.isOriginallyEncrypted && !isPrivate(this.rating))) {
// If user confirmed unsecure sending, there's nothing we need to do.
if (this.confirmSendUnsecure()) return;
@ -358,8 +358,8 @@ var pEpComposer = {
confirmSendUnsecure() {
// Open dialog and ask the user to send mail unencrypted.
const flags = Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0
+ Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1;
const flags = Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_1;
return (Services.prompt.confirmEx(
window,
"Privacy Reminder", // L10N


+ 2
- 2
chrome/content/pepmsghdrview.js View File

@ -303,8 +303,8 @@ var pEpHdrView = {
// Find the account for this message and check its preference.
let msgRoot = msgHdr.folder.server.rootFolder;
for (let account of fixIterator(MailServices.accounts.accounts, Ci.nsIMsgAccount)) {
if (msgRoot == account.incomingServer.rootMsgFolder
&& !Services.prefs.getBoolPref(`mail.account.${account.key}.storeSecurely`, true)) {
if (msgRoot == account.incomingServer.rootMsgFolder &&
!Services.prefs.getBoolPref(`mail.account.${account.key}.storeSecurely`, true)) {
TbHelper.copyMessageToFolder(msgHdr, newSubject, mimeMessage);
break;
}


Loading…
Cancel
Save