mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fixed notifications
This commit is contained in:
@@ -19,8 +19,7 @@ var async = require('async'),
|
||||
|
||||
Notifications.get = function(nid, uid, callback) {
|
||||
|
||||
db.exists('nofitications:' + nid, function(err, exists) {
|
||||
|
||||
db.exists('notifications:' + nid, function(err, exists) {
|
||||
if(!exists) {
|
||||
return callback(null);
|
||||
}
|
||||
|
||||
@@ -1039,8 +1039,12 @@ var bcrypt = require('bcrypt'),
|
||||
},
|
||||
getUnreadByUniqueId: function(uid, uniqueId, callback) {
|
||||
db.getSortedSetRange('uid:' + uid + ':notifications:unread', 0, -1, function(err, nids) {
|
||||
|
||||
async.filter(nids, function(nid, next) {
|
||||
notifications.get(nid, uid, function(notifObj) {
|
||||
if(!notifObj) {
|
||||
next(false);
|
||||
}
|
||||
if (notifObj.uniqueId === uniqueId) {
|
||||
next(true);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user