mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-20 00:50:24 +02:00
fix(chat): thumbs-up configure item
This commit is contained in:
5
config/env/torrents.js
vendored
5
config/env/torrents.js
vendored
@@ -46,6 +46,10 @@ module.exports = {
|
||||
value: 5,
|
||||
enable: true
|
||||
}
|
||||
},
|
||||
thumbsUpScore:{
|
||||
torrent: 10,
|
||||
topic: 10
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
@@ -181,7 +185,6 @@ module.exports = {
|
||||
{name: 'DISCUSS', value: 'discuss', index: 1},
|
||||
{name: 'BUSINESS', value: 'business', index: 2}
|
||||
],
|
||||
thumbs_up_score: 10,
|
||||
show_thumbs_up_user_list: true
|
||||
},
|
||||
itemsPerPage: {
|
||||
|
||||
@@ -19,7 +19,7 @@ var path = require('path'),
|
||||
traceLogCreate = require(path.resolve('./config/lib/tracelog')).create;
|
||||
|
||||
var traceConfig = config.meanTorrentConfig.trace;
|
||||
var forumsConfig = config.meanTorrentConfig.forumsConfig;
|
||||
var thumbsUpScore = config.meanTorrentConfig.score.thumbsUpScore;
|
||||
|
||||
/**
|
||||
* list forums
|
||||
@@ -510,7 +510,7 @@ exports.thumbsUp = function (req, res) {
|
||||
var topic = req.topic;
|
||||
var thumb = new Thumb();
|
||||
thumb.user = req.user;
|
||||
thumb.score = forumsConfig.thumbs_up_score;
|
||||
thumb.score = thumbsUpScore.topic;
|
||||
|
||||
if (req.query.replyId) {
|
||||
topic._replies.forEach(function (r) {
|
||||
@@ -527,10 +527,10 @@ exports.thumbsUp = function (req, res) {
|
||||
message: 'ALREADY_THUMBS_UP'
|
||||
});
|
||||
} else {
|
||||
if (req.user.score >= forumsConfig.thumbs_up_score) {
|
||||
if (req.user.score >= thumbsUpScore.topic) {
|
||||
r._scoreList.push(thumb);
|
||||
r.user.update({
|
||||
$inc: {score: forumsConfig.thumbs_up_score}
|
||||
$inc: {score: thumbsUpScore.topic}
|
||||
}).exec();
|
||||
save();
|
||||
} else {
|
||||
@@ -554,10 +554,10 @@ exports.thumbsUp = function (req, res) {
|
||||
message: 'ALREADY_THUMBS_UP'
|
||||
});
|
||||
} else {
|
||||
if (req.user.score >= forumsConfig.thumbs_up_score) {
|
||||
if (req.user.score >= thumbsUpScore.topic) {
|
||||
topic._scoreList.push(thumb);
|
||||
topic.user.update({
|
||||
$inc: {score: forumsConfig.thumbs_up_score}
|
||||
$inc: {score: thumbsUpScore.topic}
|
||||
}).exec();
|
||||
save();
|
||||
} else {
|
||||
@@ -580,7 +580,7 @@ exports.thumbsUp = function (req, res) {
|
||||
});
|
||||
|
||||
user.update({
|
||||
$inc: {score: -forumsConfig.thumbs_up_score}
|
||||
$inc: {score: -thumbsUpScore.topic}
|
||||
}).exec();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user