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);