Bug 1275974 - Notifications should use displayMessage. r=aleth a=jorgk
authorArlo Breault <arlolra@gmail.com>
Thu, 26 May 2016 09:56:16 -0700
changeset 27202 876e5702c9f45185ccf2ac83ea877d29e2317c54
parent 27201 12128f286d4d74440cfa82d84710e88cc52103a0
child 27203 0fbf7043a8399ee9d8b0b02823d63286eb5be4e5
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth, jorgk
bugs1275974
Bug 1275974 - Notifications should use displayMessage. r=aleth a=jorgk
im/modules/ibNotifications.jsm
mail/components/im/modules/chatNotifications.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, " ");
--- a/mail/components/im/modules/chatNotifications.jsm
+++ b/mail/components/im/modules/chatNotifications.jsm
@@ -59,17 +59,17 @@ var Notifications = {
     let messageText, icon, name;
     let notificationContent = Services.prefs.getIntPref("mail.chat.notification_info");
     // 0 - show all the info,
     // 1 - show only the sender not the message,
     // 2 - show no details about the message being notified.
     switch (notificationContent) {
       case 0:
         let parser = Cc["@mozilla.org/xmlextras/domparser;1"].createInstance(Ci.nsIDOMParser);
-        let doc = parser.parseFromString(aMessage.message, "text/html");
+        let doc = parser.parseFromString(aMessage.displayMessage, "text/html");
         let body = doc.querySelector("body");
         let encoder =
           Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
            .createInstance(Ci.nsIDocumentEncoder);
         encoder.init(doc, "text/plain", 0);
         encoder.setNode(body);
         messageText = encoder.encodeToString().replace(/\s+/g, " ");