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