Browse Source

Follow-up to rev. c80cab35d1f1: Show FPRs on the privacy bar.

1.1.101
Jorg Knobloch 2 years ago
parent
commit
3ccca0822b
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      addon/content/pepmsghdrview.js

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

@ -443,11 +443,11 @@ var pEpHdrView = {
let keyList = message.opt_fields.find((e) => e.key == "X-KeyList");
if (keyList) msgHdr.setStringProperty("pEpKeyList", keyList.value);
msgHdr.setStringProperty("pEpPrivacyRating", rating.toString(10));
this.updatePrivacy(this.win, msgHdr, rating);
this.updatePrivacy(this.win, msgHdr, rating, keyList.value);
pEpController.log.debug("updatePrivacyFromMessage: set rating to ", rating, keyList, isDraftorTemplate);
},
updatePrivacy(win, msgHdr, rating) {
updatePrivacy(win, msgHdr, rating, keyList = null) {
// Remove old display.
const oldNode = win.document.getElementById(TAG_PRIVACY_NODE_ID);
if (oldNode) {
@ -465,7 +465,11 @@ var pEpHdrView = {
newNode.classList.add(pEpController.colorFromRating(rating));
newNode.id = TAG_PRIVACY_NODE_ID;
const privacyLabel = this.getLocaleMessage(pEpController.textFromRating(rating));
let privacyLabel = this.getLocaleMessage(pEpController.textFromRating(rating));
if (keyList && Services.prefs.getBoolPref("extensions.pEp.showFPR", false)) {
// eslint-disable-next-line prefer-template
privacyLabel += " - FPR: " + keyList;
}
const privacyTextNode = win.document.createTextNode(privacyLabel);
newNode.appendChild(privacyTextNode);


Loading…
Cancel
Save