v1.18.x
Julian Lam 9 years ago
parent b2049e7acf
commit fe90dd77c1

@ -64,6 +64,8 @@ var async = require('async'),
}
function getNotificationsFromSet(set, read, uid, start, stop, callback) {
var setNids;
async.waterfall([
async.apply(db.getSortedSetRevRange, set, start, stop),
function(nids, next) {
@ -71,6 +73,7 @@ var async = require('async'),
return callback(null, []);
}
setNids = nids;
UserNotifications.getNotifications(nids, uid, next);
},
function(notifs, next) {
@ -78,8 +81,8 @@ var async = require('async'),
notifs.forEach(function(notification, index) {
if (!notification) {
winston.verbose('[notifications.get] nid ' + notification.nid + ' not found. Removing.');
deletedNids.push(notification.nid);
winston.verbose('[notifications.get] nid ' + setNids[index] + ' not found. Removing.');
deletedNids.push(setNids[index]);
} else {
notification.read = read;
notification.readClass = !notification.read ? 'unread' : '';

Loading…
Cancel
Save