Skip to content

Node.js based forum software built for the modern web

allow array of nids to be passed to notifs.get

barisusakli87a194a4bd32
diff --git a/src/socket.io/notifications.js b/src/socket.io/notifications.js
index cb93e1ca45..c957fff1a7 100644
--- a/src/socket.io/notifications.js
+++ b/src/socket.io/notifications.js
@@ -5,7 +5,11 @@ var user = require('../user'),
SocketNotifs = {};
SocketNotifs.get = function(socket, data, callback) {
- user.notifications.get(socket.uid, callback);
+ if (data && Array.isArray(data.nids) && socket.uid) {
+ user.notifications.getNotifications(data.nids, socket.uid, callback);
+ } else {
+ user.notifications.get(socket.uid, callback);
+ }
};
SocketNotifs.getCount = function(socket, data, callback) {