|
|
|
@ -16,7 +16,7 @@ module.exports = function (SocketTopics) {
|
|
|
|
|
if (!data) {
|
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
|
}
|
|
|
|
|
var topic;
|
|
|
|
|
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function (next) {
|
|
|
|
|
async.parallel({
|
|
|
|
@ -32,16 +32,13 @@ module.exports = function (SocketTopics) {
|
|
|
|
|
if (!results.topic) {
|
|
|
|
|
return next(new Error('[[error:no-topic]]'));
|
|
|
|
|
}
|
|
|
|
|
topic = results.topic;
|
|
|
|
|
topic.privileges = results.privileges;
|
|
|
|
|
|
|
|
|
|
results.topic.privileges = results.privileges;
|
|
|
|
|
plugins.fireHook('filter:topic.thread_tools', { topic: results.topic, uid: socket.uid, tools: [] }, next);
|
|
|
|
|
},
|
|
|
|
|
function (data, next) {
|
|
|
|
|
topic.deleted = parseInt(topic.deleted, 10) === 1;
|
|
|
|
|
topic.locked = parseInt(topic.locked, 10) === 1;
|
|
|
|
|
topic.pinned = parseInt(topic.pinned, 10) === 1;
|
|
|
|
|
topic.thread_tools = data.tools;
|
|
|
|
|
next(null, topic);
|
|
|
|
|
data.topic.thread_tools = data.tools;
|
|
|
|
|
next(null, data.topic);
|
|
|
|
|
},
|
|
|
|
|
], callback);
|
|
|
|
|
};
|
|
|
|
|