Browse Source

P4TB-341: Follow-up: Encode body preview in UTF-8 (otherwise display of notification fails). 1.1.105-preview-3.

master
Jörg Knobloch 1 year ago
parent
commit
135bffbb44
2 changed files with 5 additions and 3 deletions
  1. +4
    -2
      addon/content/pEpForThunderbird.js
  2. +1
    -1
      addon/manifest.json

+ 4
- 2
addon/content/pEpForThunderbird.js View File

@ -671,8 +671,10 @@ class pEpForThunderbird extends pEp {
preview = parserUtils.convertToPlainText(decryptedMessage.longmsg_formatted, flags, 0);
}
if (preview) {
preview = preview.trim().replace(/\s+/g, " ");
msgHdr.setStringProperty("preview", preview.substring(0, 255));
preview = preview.trim().replace(/\s+/g, " ").substring(0, 255);
// The database doesn't like UTF-16 apparently. So encode into UTF-8.
preview = String.fromCharCode.apply(undefined, new TextEncoder("UTF-8").encode(preview));
msgHdr.setStringProperty("preview", preview);
}
let keyList = decryptedMessage.opt_fields.find((e) => e.key == "X-KeyList");


+ 1
- 1
addon/manifest.json View File

@ -4,7 +4,7 @@
"description": "p≡p message encryption and authentication",
"author": "p≡p Team for Thunderbird",
"homepage_url": "https://pep.security",
"version": "1.1.105-preview-2",
"version": "1.1.105-preview-3",
"default_locale": "en",
"applications": {
"gecko": {


Loading…
Cancel
Save