Merge branch 'master' of github.com:nodebb/NodeBB

v1.18.x
Julian Lam 11 years ago
commit d706c390bb

@ -172,6 +172,7 @@ topicsController.get = function(req, res, next) {
}
data.privileges = userPrivileges;
data['reputation:disabled'] = meta.config['reputation:disabled'] === '1' ? true : false;
var topic_url = tid + (req.params.slug ? '/' + req.params.slug : '');
var queryString = qs.stringify(req.query);

@ -98,10 +98,18 @@ var async = require('async'),
}
Favourites.upvote = function(pid, uid, callback) {
if (meta.config['reputation:disabled'] === false) {
return callback(false);
}
toggleVote('upvote', pid, uid, callback);
};
Favourites.downvote = function(pid, uid, callback) {
if (meta.config['reputation:disabled'] === false) {
return callback(false);
}
user.getUserField(uid, 'reputation', function(err, reputation) {
if (reputation < meta.config['privileges:downvote']) {
return callback(new Error('[[error:not-enough-reputation-to-downvote]]'));

Loading…
Cancel
Save