moved topic locked check to topic.reply

v1.18.x
Baris Soner Usakli 11 years ago
parent 77f5d6ff7d
commit fb691b23b4

@ -37,13 +37,6 @@ var db = require('./database'),
async.waterfall([ async.waterfall([
function(next) { function(next) {
topics.isLocked(tid, next);
},
function(locked, next) {
if(locked) {
return next(new Error('topic-locked'));
}
db.incrObjectField('global', 'nextPid', next); db.incrObjectField('global', 'nextPid', next);
}, },
function(pid, next) { function(pid, next) {

@ -171,6 +171,14 @@ var async = require('async'),
if (!topicExists) { if (!topicExists) {
return next(new Error('topic doesn\'t exist')); return next(new Error('topic doesn\'t exist'));
} }
Topics.isLocked(tid, next);
},
function(locked, next) {
if (locked) {
return next(new Error('topic-locked'));
}
threadTools.privileges(tid, uid, next); threadTools.privileges(tid, uid, next);
}, },
function(privilegesData, next) { function(privilegesData, next) {

Loading…
Cancel
Save