From de007772a489fd47fffa7f29e3263ba4855f3c9b Mon Sep 17 00:00:00 2001 From: Accalia de Elementia Date: Sat, 13 Aug 2016 12:50:06 +0000 Subject: [PATCH] feat: Allow listing all groups via websocket also add missing radix to parsing of `after` in groups.loadMore websocket method. --- src/socket.io/groups.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/socket.io/groups.js b/src/socket.io/groups.js index 7d9ce46a70..5df97f80f5 100644 --- a/src/socket.io/groups.js +++ b/src/socket.io/groups.js @@ -217,12 +217,12 @@ SocketGroups.search = function(socket, data, callback) { }; SocketGroups.loadMore = function(socket, data, callback) { - if (!data.sort || !data.after) { + if (!data.sort || !utils.isNumber(data.after) || parseInt(data.after, 10) < 0) { return callback(); } var groupsPerPage = 9; - var start = parseInt(data.after); + var start = parseInt(data.after, 10); var stop = start + groupsPerPage - 1; groupsController.getGroupsFromSet(socket.uid, data.sort, start, stop, callback); };