mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -14,7 +14,6 @@ var pubsub = require('../pubsub');
|
||||
var utils = require('../../public/src/utils');
|
||||
|
||||
module.exports = function (Posts) {
|
||||
|
||||
pubsub.on('post:edit', function (pid) {
|
||||
cache.del(pid);
|
||||
});
|
||||
@@ -45,7 +44,7 @@ module.exports = function (Posts) {
|
||||
if (data.handle) {
|
||||
postData.handle = data.handle;
|
||||
}
|
||||
plugins.fireHook('filter:post.edit', {req: data.req, post: postData, data: data, uid: data.uid}, next);
|
||||
plugins.fireHook('filter:post.edit', { req: data.req, post: postData, data: data, uid: data.uid }, next);
|
||||
},
|
||||
function (result, next) {
|
||||
postData = result.post;
|
||||
@@ -58,7 +57,7 @@ module.exports = function (Posts) {
|
||||
},
|
||||
topic: function (next) {
|
||||
editMainPost(data, postData, next);
|
||||
}
|
||||
},
|
||||
}, next);
|
||||
},
|
||||
function (_results, next) {
|
||||
@@ -76,7 +75,7 @@ module.exports = function (Posts) {
|
||||
function (postData, next) {
|
||||
results.post = postData;
|
||||
next(null, results);
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
};
|
||||
|
||||
@@ -90,7 +89,7 @@ module.exports = function (Posts) {
|
||||
},
|
||||
isMain: function (next) {
|
||||
Posts.isMain(data.pid, next);
|
||||
}
|
||||
},
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
@@ -101,7 +100,7 @@ module.exports = function (Posts) {
|
||||
tid: tid,
|
||||
cid: results.topic.cid,
|
||||
isMainPost: false,
|
||||
renamed: false
|
||||
renamed: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -109,7 +108,7 @@ module.exports = function (Posts) {
|
||||
tid: tid,
|
||||
cid: results.topic.cid,
|
||||
uid: postData.uid,
|
||||
mainPid: data.pid
|
||||
mainPid: data.pid,
|
||||
};
|
||||
|
||||
if (title) {
|
||||
@@ -123,7 +122,7 @@ module.exports = function (Posts) {
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
plugins.fireHook('filter:topic.edit', {req: data.req, topic: topicData, data: data}, next);
|
||||
plugins.fireHook('filter:topic.edit', { req: data.req, topic: topicData, data: data }, next);
|
||||
},
|
||||
function (results, next) {
|
||||
db.setObject('topic:' + tid, results.topic, next);
|
||||
@@ -147,12 +146,10 @@ module.exports = function (Posts) {
|
||||
slug: topicData.slug,
|
||||
isMainPost: true,
|
||||
renamed: title !== results.topic.title,
|
||||
tags: tags
|
||||
tags: tags,
|
||||
});
|
||||
}
|
||||
},
|
||||
], callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user