Bug 1070953 - Message style preview is broken, r=florian.
authorArlo Breault <arlolra@gmail.com>
Mon, 22 Sep 2014 15:25:27 -0700
changeset 16827 2b6f0a6859958c9b57b3975001ee7aac257d9ae8
parent 16826 e78fb70d94195692f78b8465dc5efbf7f00f1f0e
child 16828 4823bbd4a723c025889c330128951b2da7e7f81a
push id10469
push userflorian@queze.net
push dateWed, 24 Sep 2014 11:04:09 +0000
treeherdercomm-central@2b6f0a685995 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian
bugs1070953
Bug 1070953 - Message style preview is broken, r=florian.
im/content/preferences/messagestyle.js
--- a/im/content/preferences/messagestyle.js
+++ b/im/content/preferences/messagestyle.js
@@ -1,30 +1,37 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let jsProtoHelper = {};
 Components.utils.import("resource:///modules/jsProtoHelper.jsm", jsProtoHelper);
 
-function Conversation(aName)
-{
+function Conversation(aName) {
   this._name = aName;
   this._observers = [];
   let now = new Date();
   this._date = new Date(now.getFullYear(), now.getMonth(), now.getDate(),
                         10, 42, 22) * 1000;
 }
 Conversation.prototype = {
   __proto__: jsProtoHelper.GenericConvIMPrototype,
   account: {protocol: {name: "Fake Protocol"},
             alias: "", name: "Fake Account",
             statusInfo: Services.core.globalUserStatus}
 };
 
+function Message(aWho, aMessage, aObject) {
+  this._init(aWho, aMessage, aObject);
+}
+Message.prototype = {
+  __proto__: jsProtoHelper.GenericMessagePrototype,
+  get displayMessage() this.originalMessage
+};
+
 // Message style tooltips use this.
 function getBrowser() document.getElementById("previewbrowser");
 
 var previewObserver = {
   _loaded: false,
   load: function() {
     gThemePane.buildThemeList("messagestyle");
 
@@ -36,17 +43,16 @@ var previewObserver = {
     };
     let bundle = document.getElementById("themesBundle");
     let msg = {};
     ["nick1", "buddy1", "nick2", "buddy2",
      "message1", "message2", "message3"].forEach(function(aText) {
       msg[aText] = bundle.getString(aText);
     });
     let conv = new Conversation(msg.nick2);
-    const Message = jsProtoHelper.Message;
     conv.messages = [
       new Message(msg.buddy1, msg.message1, {outgoing: true, _alias: msg.nick1, time: makeDate("10:42:22"), _conversation: conv}),
       new Message(msg.buddy1, msg.message2, {outgoing: true, _alias: msg.nick1, time: makeDate("10:42:25"), _conversation: conv}),
       new Message(msg.buddy2, msg.message3, {incoming: true, _alias: msg.nick2, time: makeDate("10:43:01"), _conversation: conv})
     ];
     previewObserver.conv = conv;
 
     let themeName = document.getElementById("messagestyle-themename");