|
|
|
@ -15,9 +15,6 @@ var utils = require('../../public/src/utils');
|
|
|
|
|
module.exports = function (Topics) {
|
|
|
|
|
Topics.onNewPostMade = function (postData, callback) {
|
|
|
|
|
async.series([
|
|
|
|
|
function (next) {
|
|
|
|
|
Topics.increasePostCount(postData.tid, next);
|
|
|
|
|
},
|
|
|
|
|
function (next) {
|
|
|
|
|
Topics.updateLastPostTime(postData.tid, postData.timestamp, next);
|
|
|
|
|
},
|
|
|
|
@ -287,6 +284,9 @@ module.exports = function (Topics) {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
function (next) {
|
|
|
|
|
Topics.increasePostCount(tid, next);
|
|
|
|
|
},
|
|
|
|
|
function (next) {
|
|
|
|
|
db.sortedSetIncrBy('tid:' + tid + ':posters', 1, postData.uid, next);
|
|
|
|
|
},
|
|
|
|
@ -304,6 +304,9 @@ module.exports = function (Topics) {
|
|
|
|
|
'tid:' + tid + ':posts:votes',
|
|
|
|
|
], postData.pid, next);
|
|
|
|
|
},
|
|
|
|
|
function (next) {
|
|
|
|
|
Topics.decreasePostCount(tid, next);
|
|
|
|
|
},
|
|
|
|
|
function (next) {
|
|
|
|
|
db.sortedSetIncrBy('tid:' + tid + ':posters', -1, postData.uid, next);
|
|
|
|
|
},
|
|
|
|
|