Bug 1275974 - Notifications should use displayMessage. r=aleth a=rkent
authorArlo Breault <arlolra@gmail.com>
Thu, 26 May 2016 09:56:16 -0700
changeset 27137 094a5e8c49269db6822d0fc6597ec16fbb6668bb
parent 27136 d48976525021b6a8c4dd6afaec37a560647bcca3
child 27138 400a26ec082840422d577ada4553a7b614519f50
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, rkent
bugs1275974
Bug 1275974 - Notifications should use displayMessage. r=aleth a=rkent
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, " ");