From 5a8b660d73ef62483d3e7d31fcd87e9393ececba Mon Sep 17 00:00:00 2001 From: aynik Date: Sat, 4 Apr 2015 14:55:26 +0200 Subject: [PATCH] Fixed attempt of parsing Msg objects --- src/client.js | 2 +- src/models/chan.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client.js b/src/client.js index fa49b12..166ba32 100644 --- a/src/client.js +++ b/src/client.js @@ -257,7 +257,7 @@ Client.prototype.more = function(data) { chan.messages.fetch(Math.max(0, count - 100), count, function(err, messages){ client.emit("more", { chan: chan.id, - messages: messages.map(log.parse) + messages: messages }); }); }; diff --git a/src/models/chan.js b/src/models/chan.js index 3dffcfb..a281273 100644 --- a/src/models/chan.js +++ b/src/models/chan.js @@ -1,6 +1,7 @@ var util = require("util"); var _ = require("lodash"); var Helper = require("../helper"); +var log = require("../log"); module.exports = Chan; @@ -38,7 +39,7 @@ MessageArray.prototype.fetch = function(from, to, callback) { else if (this.log) { var linesFrom = from + messages.length; Helper.getLines(this.log, linesFrom, to, function(err, lines){ - callback(null, messages.concat(lines)); + callback(null, messages.concat(lines.map(log.parse))); }); } else callback(null, messages);