Bug 799068 - Land in comm-central Instantbird's changes to chat/ - 3 - Bio 1236 - JSON log viewer conversation bubbles should have the same colors as when the conversation happened, r=fqueze.
authoraleth <aletheia2@fastmail.fm>
Sun, 05 Aug 2012 00:37:17 +0200
changeset 13840 74017bd357467fae251a87e2cad731d008d1b77d
parent 13839 d8163dea2a0493649b7c4be669bd9bf1b0e5d813
child 13841 6155d672e6e6164e06d2e1b0c2d0a08f70a682bf
push id762
push userbugzilla@standard8.plus.com
push dateMon, 19 Nov 2012 21:16:42 +0000
treeherdercomm-beta@4a2f61509b17 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfqueze
bugs799068
Bug 799068 - Land in comm-central Instantbird's changes to chat/ - 3 - Bio 1236 - JSON log viewer conversation bubbles should have the same colors as when the conversation happened, r=fqueze.
chat/components/src/logger.js
--- a/chat/components/src/logger.js
+++ b/chat/components/src/logger.js
@@ -99,17 +99,18 @@ ConversationLog.prototype = {
   _getHeader: function cl_getHeader()
   {
     let account = this._conv.account;
     if (this.format == "json") {
       return JSON.stringify({date: new Date(),
                              name: this._conv.name,
                              title: this._conv.title,
                              account: account.normalizedName,
-                             protocol: account.protocol.normalizedName
+                             protocol: account.protocol.normalizedName,
+                             isChat: this._conv.isChat
                             }) + "\n";
     }
     return "Conversation with " + this._conv.name +
            " at " + (new Date).toLocaleString() +
            " on " + account.name +
            " (" + account.protocol.normalizedName + ")" + kLineBreak;
   },
   _serialize: function cl_serialize(aString) {
@@ -320,16 +321,17 @@ function LogConversation(aLineInputStrea
       throw "bad log file";
 
     if (firstFile) {
       let data = JSON.parse(line.value);
       this.name = data.name;
       this.title = data.title;
       this._accountName = data.account;
       this._protocolName = data.protocol;
+      this._isChat = data.isChat;
       firstFile = false;
     }
 
     while (more) {
       more = inputStream.readLine(line);
       if (!line.value)
         break;
       try {
@@ -339,17 +341,17 @@ function LogConversation(aLineInputStrea
         // if a message line contains junk, just ignore the error and
         // continue reading the conversation.
       }
     }
   }
 }
 LogConversation.prototype = {
   __proto__: ClassInfo("imILogConversation", "Log conversation object"),
-  get isChat() false,
+  get isChat() this._isChat,
   get buddy() null,
   get account() ({
     alias: "",
     name: this._accountName,
     normalizedName: this._accountName,
     protocol: {name: this._protocolName},
     statusInfo: Services.core.globalUserStatus
   }),