prematurely removing null objects before they get parsed as messages

v1.18.x
Julian Lam 10 years ago
parent 5931255398
commit 62f1a788e0

@ -142,7 +142,7 @@ var db = require('./database'),
async.waterfall([ async.waterfall([
async.apply(db.getObjects, keys), async.apply(db.getObjects, keys),
function(messages, next) { function(messages, next) {
async.map(messages, function(message, next) { async.filter(Boolean).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];
message.toUser = self ? userData[1] : userData[0]; message.toUser = self ? userData[1] : userData[0];

Loading…
Cancel
Save