v1.18.x
psychobunny 9 years ago
parent 2d0224d42a
commit ff83305c6a

@ -255,20 +255,16 @@ var db = require('./database'),
user.getMultipleUserFields(uids, ['uid', 'username', 'picture', 'status'] , next); user.getMultipleUserFields(uids, ['uid', 'username', 'picture', 'status'] , next);
}, },
teasers: function(next) { teasers: function(next) {
var teasers = []; async.map(uids, function(fromuid, next) {
async.each(uids, function(fromuid, next) {
Messaging.getMessages({ Messaging.getMessages({
fromuid: fromuid, fromuid: fromuid,
touid: uid, touid: uid,
isNew: false, isNew: false,
count: 1 count: 1
}, function(err, teaser) { }, function(err, teaser) {
teasers[uids.indexOf(fromuid)] = teaser[0]; next(err, teaser[0]);
next(err);
}); });
}, function(err) { }, next);
next(err, teasers);
});
} }
}, function(err, results) { }, function(err, results) {
if (err) { if (err) {

Loading…
Cancel
Save