This commit is contained in:
Julian Lam
2016-04-29 12:54:53 -04:00
parent 1cdd4eaaf5
commit bd8fcb527b
4 changed files with 72 additions and 11 deletions

View File

@@ -81,6 +81,21 @@ var plugins = require('./plugins');
});
};
Notifications.filterExists = function(nids, callback) {
// Removes nids that have been pruned
db.isSortedSetMembers('notifications', nids, function(err, exists) {
if (err) {
return callbacK(err);
}
nids = nids.filter(function(notifId, idx) {
return exists[idx];
});
callback(null, nids);
});
};
Notifications.findRelated = function(mergeIds, set, callback) {
// A related notification is one in a zset that has the same mergeId
var _nids;