[tor-commits] [tor-messenger-build/master] Display plaintext in notifications

arlo at torproject.org arlo at torproject.org
Thu May 26 17:07:26 UTC 2016


commit 2e42cdb764e54eb383a780ffc08d43ba547fbb45
Author: Arlo Breault <arlolra at gmail.com>
Date:   Thu May 26 10:06:43 2016 -0700

    Display plaintext in notifications
    
     * Trac 19053
---
 ChangeLog                             |  1 +
 projects/instantbird/config           |  1 +
 projects/instantbird/trac-19053.patch | 30 ++++++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2ea3727..aa38690 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@ Tor Messenger 0.1.0b7 --
  * All Platforms
    * Use the THUNDERBIRD_45_1_0_RELEASE tag on mozilla-esr45
    * Use the THUNDERBIRD_45_1_0_RELEASE tag on comm-esr45
+   * Bug 19053: Display plaintext in notifications
    * ctypes-otr
      * GH 66: Provide functionality for adding verified fingerprints (patch by Vu Quoc Huy)
 
diff --git a/projects/instantbird/config b/projects/instantbird/config
index 9215a98..32306e6 100644
--- a/projects/instantbird/config
+++ b/projects/instantbird/config
@@ -73,6 +73,7 @@ input_files:
   - filename: trac-17896.patch
   - filename: trac-17494.patch
   - filename: trac-13312.patch
+  - filename: trac-19053.patch
   - filename: version.patch
   - filename: search-context-menu.patch
   - filename: search-preferences-xul.patch
diff --git a/projects/instantbird/trac-19053.patch b/projects/instantbird/trac-19053.patch
new file mode 100644
index 0000000..e4267da
--- /dev/null
+++ b/projects/instantbird/trac-19053.patch
@@ -0,0 +1,30 @@
+# HG changeset patch
+# User Arlo Breault <arlolra at gmail.com>
+# Date 1464281776 25200
+#      Thu May 26 09:56:16 2016 -0700
+# Node ID f7624aac9022c38cfec6b2bc4f73ad69a5cf2a04
+# Parent  664eff8ea96f4bb2c15aa3ff01fd7c33e5cc3480
+Notification should use message prepared for dislaying
+
+diff --git a/im/modules/ibNotifications.jsm b/im/modules/ibNotifications.jsm
+--- a/im/modules/ibNotifications.jsm
++++ b/im/modules/ibNotifications.jsm
+@@ -20,17 +20,17 @@ var Notifications = {
+     } catch (e) { }
+     return ellipsis;
+   },
+ 
+   _showMessageNotification: function (aMessage) {
+     // Put the message content into a div node of the hidden HTML window.
+     let doc = getHiddenHTMLWindow().document;
+     let xhtmlElement = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
+-    xhtmlElement.innerHTML = aMessage.message.replace(/<br>/gi, "<br/>");
++    xhtmlElement.innerHTML = aMessage.displayMessage.replace(/<br>/gi, "<br/>");
+ 
+     // Convert the div node content to plain text.
+     let encoder =
+       Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
+                 .createInstance(Components.interfaces.nsIDocumentEncoder);
+     encoder.init(doc, "text/plain", 0);
+     encoder.setNode(xhtmlElement);
+     let messageText = encoder.encodeToString().replace(/\s+/g, " ");



More information about the tor-commits mailing list