Browse Source

P4TB-360: Hide attachments of content type "application/pgp-keys", "application/pgp-signature", "application/pep.sync", "application/pep.sign", "application/pep.distribution".

1.1.101
Jorg Knobloch 2 years ago
parent
commit
75b1d189b3
3 changed files with 7 additions and 6 deletions
  1. +5
    -0
      addon/content/TbHelper.js
  2. +1
    -3
      addon/content/pepmessengercompose.js
  3. +1
    -3
      addon/content/pepmsghdrview.js

+ 5
- 0
addon/content/TbHelper.js View File

@ -7,6 +7,11 @@ var { fixIterator } = ChromeUtils.import("resource:///modules/iteratorUtils.jsm"
const TbHelper = {
messageBeingReplaced: null,
shouldHideAttachment(type) {
return ["application/pgp-keys", "application/pgp-signature",
"application/pep.sync", "application/pep.sign", "application/pep.distribution"].includes(type.toLowerCase());
},
isFolderStoreSecurely(folder, controller) {
let folderRoot = folder.server.rootFolder;
let storeSecurely = true;


+ 1
- 3
addon/content/pepmessengercompose.js View File

@ -331,9 +331,7 @@ var pEpComposer = {
let rowCount = bucket.getRowCount();
for (let i = rowCount - 1; i >= 0; i--) {
let attach = bucket.getItemAtIndex(i).attachment;
if (attach &&
(attach.contentType.toLowerCase() == "application/pep.sync" ||
attach.contentType.toLowerCase() == "application/pep.sign")) {
if (attach && TbHelper.shouldHideAttachment(attach.contentType)) {
msgCompFields.removeAttachment(attach);
bucket.getItemAtIndex(i).remove();
removedCount++;


+ 1
- 3
addon/content/pepmsghdrview.js View File

@ -317,9 +317,7 @@ var pEpHdrView = {
// Remove attachments of type application/pgp-keys.
let attLength = this.win.currentAttachments.length;
for (let i = this.win.currentAttachments.length - 1; i >= 0; i--) {
if (this.win.currentAttachments[i].contentType.search(/^application\/pgp-keys/i) === 0 ||
this.win.currentAttachments[i].contentType.search(/^application\/pEp\.sync/i) === 0 ||
this.win.currentAttachments[i].contentType.search(/^application\/pEp\.sign/i) === 0) {
if (TbHelper.shouldHideAttachment(this.win.currentAttachments[i].contentType)) {
this.win.currentAttachments.splice(i, 1);
}
}


Loading…
Cancel
Save