Node.js based forum software built for the modern web
fixing regression for #2355, introduced in a129075
Julian Lam7e35987e1b63
diff --git a/public/src/client/category.js b/public/src/client/category.jsindex 9e461734a5..073d3568aa 100644--- a/public/src/client/category.js+++ b/public/src/client/category.js@@ -332,7 +332,8 @@ define('forum/category', ['composer', 'forum/pagination', 'forum/infinitescroll'$(window).trigger('action:categories.loading');infinitescroll.loadMore('categories.loadMore', {cid: ajaxify.variables.get('category_id'),- after: after+ after: after,+ author: utils.getQueryParams().author}, function (data, done) {if (data.topics && data.topics.length) {diff --git a/public/src/utils.js b/public/src/utils.jsindex 4e5a4469b1..a3f3be9648 100644--- a/public/src/utils.js+++ b/public/src/utils.js@@ -305,6 +305,24 @@return a;},+ getQueryParams: function() {+ var search = window.location.search.slice(1),+ data = {};++ search = search.split('&');+ for(var x=0,numParams=search.length,temp;x<numParams;x++) {+ temp = search[x].split('=');+ if (temp[0].substr(-2, 2) !== '[]') {+ data[temp[0]] = temp[1];+ } else {+ data[temp[0].slice(0, -2)] = data[temp[0].slice(0, -2)] || [];+ data[temp[0].slice(0, -2)].push(temp[1]);+ }+ }++ return data;+ },+// return boolean if string 'true' or string 'false', or if a parsable string which is a number// also supports JSON object and/or arrays parsingtoType: function(str) {diff --git a/src/socket.io/categories.js b/src/socket.io/categories.jsindex bafed3b587..57a13d0a58 100644--- a/src/socket.io/categories.js+++ b/src/socket.io/categories.js@@ -39,6 +39,13 @@ SocketCategories.loadMore = function(socket, data, callback) {},settings: function(next) {user.getSettings(socket.uid, next);+ },+ targetUid: function(next) {+ if (data.author) {+ user.getUidByUserslug(data.author, next);+ } else {+ next();+ }}}, function(err, results) {if (err) {@@ -55,8 +62,9 @@ SocketCategories.loadMore = function(socket, data, callback) {categories.getCategoryTopics({cid: data.cid,start: start,- end: end,- uid: socket.uid+ stop: end,+ uid: socket.uid,+ targetUid: results.targetUid}, function(err, data) {if (err) {return callback(err);