v1.18.x
Barış Soner Uşaklı 7 years ago
parent d60d03d00f
commit f77e7de285

@ -207,7 +207,6 @@ module.exports = function (Topics) {
Topics.reply = function (data, callback) { Topics.reply = function (data, callback) {
var tid = data.tid; var tid = data.tid;
var uid = data.uid; var uid = data.uid;
var content = data.content;
var postData; var postData;
async.waterfall([ async.waterfall([
@ -248,23 +247,15 @@ module.exports = function (Topics) {
plugins.fireHook('filter:topic.reply', data, next); plugins.fireHook('filter:topic.reply', data, next);
}, },
function (filteredData, next) { function (filteredData, next) {
content = filteredData.content || data.content; if (data.content) {
if (content) { data.content = utils.rtrim(data.content);
content = utils.rtrim(content);
} }
check(content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next); check(data.content, meta.config.minimumPostLength, meta.config.maximumPostLength, 'content-too-short', 'content-too-long', next);
}, },
function (next) { function (next) {
posts.create({ data.ip = data.req ? data.req.ip : null;
uid: uid, posts.create(data, next);
tid: tid,
handle: data.handle,
content: content,
toPid: data.toPid,
timestamp: data.timestamp,
ip: data.req ? data.req.ip : null,
}, next);
}, },
function (_postData, next) { function (_postData, next) {
postData = _postData; postData = _postData;

Loading…
Cancel
Save