Bug 1275974 - Notifications should use displayMessage. r=aleth a=rkent
authorArlo Breault <arlolra@gmail.com>
Thu, 26 May 2016 09:56:16 -0700
changeset 24741 297a49adcb350cecd343ab2b331f0c2808320614
parent 24740 2aaf5cbd9aaaa606536c20a8663de4659ade9f6b
child 24742 b050956b8c551c1e22ad26bcdb9b08ab592a22b5
push id64
push userkent@caspia.com
push dateMon, 27 Jun 2016 04:17:13 +0000
treeherdercomm-esr45@b050956b8c55 [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, " ");