From d67cd489cddedb7badfbe8b1dbed362137d5aab7 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 27 Aug 2014 14:09:15 -0400 Subject: [PATCH 1/2] crash fix --- src/user/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }); From 347fc05376364e8738d63908321098873bd92c0a Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 27 Aug 2014 15:03:36 -0400 Subject: [PATCH 2/2] getPidIndex socket call --- src/socket.io/posts.js | 4 ++++ 1 file changed, 4 insertions(+) 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;