mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -6,9 +6,9 @@ var db = require('../database');
|
||||
var topics = require('../topics');
|
||||
var plugins = require('../plugins');
|
||||
|
||||
module.exports = function(Categories) {
|
||||
module.exports = function (Categories) {
|
||||
|
||||
Categories.getCategoryTopics = function(data, callback) {
|
||||
Categories.getCategoryTopics = function (data, callback) {
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
plugins.fireHook('filter:category.topics.prepare', data, next);
|
||||
@@ -36,12 +36,12 @@ module.exports = function(Categories) {
|
||||
], callback);
|
||||
};
|
||||
|
||||
Categories.modifyTopicsByPrivilege = function(topics, privileges) {
|
||||
Categories.modifyTopicsByPrivilege = function (topics, privileges) {
|
||||
if (!Array.isArray(topics) || !topics.length || privileges.isAdminOrMod) {
|
||||
return;
|
||||
}
|
||||
|
||||
topics.forEach(function(topic) {
|
||||
topics.forEach(function (topic) {
|
||||
if (topic.deleted && !topic.isOwner) {
|
||||
topic.title = '[[topic:topic_is_deleted]]';
|
||||
topic.slug = topic.tid;
|
||||
@@ -52,7 +52,7 @@ module.exports = function(Categories) {
|
||||
});
|
||||
};
|
||||
|
||||
Categories.getTopicIds = function(set, reverse, start, stop, callback) {
|
||||
Categories.getTopicIds = function (set, reverse, start, stop, callback) {
|
||||
if (Array.isArray(set)) {
|
||||
db[reverse ? 'getSortedSetRevIntersect' : 'getSortedSetIntersect']({sets: set, start: start, stop: stop}, callback);
|
||||
} else {
|
||||
@@ -60,8 +60,8 @@ module.exports = function(Categories) {
|
||||
}
|
||||
};
|
||||
|
||||
Categories.getTopicIndex = function(tid, callback) {
|
||||
topics.getTopicField(tid, 'cid', function(err, cid) {
|
||||
Categories.getTopicIndex = function (tid, callback) {
|
||||
topics.getTopicField(tid, 'cid', function (err, cid) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -70,29 +70,29 @@ module.exports = function(Categories) {
|
||||
});
|
||||
};
|
||||
|
||||
Categories.onNewPostMade = function(cid, pinned, postData, callback) {
|
||||
Categories.onNewPostMade = function (cid, pinned, postData, callback) {
|
||||
if (!cid || !postData) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
async.parallel([
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetAdd('cid:' + cid + ':pids', postData.timestamp, postData.pid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.incrObjectField('category:' + cid, 'post_count', next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
if (parseInt(pinned, 10) === 1) {
|
||||
next();
|
||||
} else {
|
||||
db.sortedSetAdd('cid:' + cid + ':tids', postData.timestamp, postData.tid, next);
|
||||
}
|
||||
},
|
||||
function(next){
|
||||
function (next){
|
||||
Categories.updateRecentTid(cid, postData.tid, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
db.sortedSetIncrBy('cid:' + cid + ':tids:posts', 1, postData.tid, next);
|
||||
}
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user