diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 3315bf2f5a..5326fc09de 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -367,4 +367,8 @@ SocketPosts.getCategory = function(socket, pid, callback) { posts.getCidByPid(pid, callback); }; +SocketPosts.getPidIndex = function(socket, pid, callback) { + posts.getPidIndex(pid, socket.uid, callback); +}; + module.exports = SocketPosts; diff --git a/src/user/notifications.js b/src/user/notifications.js index b6e82e6d23..9d43845b9c 100644 --- a/src/user/notifications.js +++ b/src/user/notifications.js @@ -254,7 +254,7 @@ var async = require('async'), } notifications = notifications.filter(function(notification) { - return !!notification || notification[field] !== value.toString(); + return notification && notification[field] !== value.toString(); }).map(function(notification) { return notification.nid; });