filter messages

v1.18.x
barisusakli 10 years ago
parent 5931255398
commit 95e9d7c798

@ -142,6 +142,9 @@ var db = require('./database'),
async.waterfall([ async.waterfall([
async.apply(db.getObjects, keys), async.apply(db.getObjects, keys),
function(messages, next) { function(messages, next) {
messages = messages.filter(Boolean);
async.map(messages, function(message, next) { async.map(messages, function(message, next) {
var self = parseInt(message.fromuid, 10) === parseInt(fromuid, 10); var self = parseInt(message.fromuid, 10) === parseInt(fromuid, 10);
message.fromUser = self ? userData[0] : userData[1]; message.fromUser = self ? userData[0] : userData[1];

Loading…
Cancel
Save