Fixed attempt of parsing Msg objects

This commit is contained in:
aynik 2015-04-04 14:55:26 +02:00
parent b5fba69545
commit 5a8b660d73
2 changed files with 3 additions and 2 deletions

View File

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

View File

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