Skip to content

Node.js based forum software built for the modern web

closes #3593

psychobunnyff83305c6a56
diff --git a/src/messaging.js b/src/messaging.js
index ab27543f96..72346d52c8 100644
--- a/src/messaging.js
+++ b/src/messaging.js
@@ -255,20 +255,16 @@ var db = require('./database'),
user.getMultipleUserFields(uids, ['uid', 'username', 'picture', 'status'] , next);
},
teasers: function(next) {
- var teasers = [];
- async.each(uids, function(fromuid, next) {
+ async.map(uids, function(fromuid, next) {
Messaging.getMessages({
fromuid: fromuid,
touid: uid,
isNew: false,
count: 1
}, function(err, teaser) {
- teasers[uids.indexOf(fromuid)] = teaser[0];
- next(err);
+ next(err, teaser[0]);
});
- }, function(err) {
- next(err, teasers);
- });
+ }, next);
}
}, function(err, results) {
if (err) {