mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
This commit is contained in:
@@ -41,7 +41,7 @@ module.exports = function(Posts) {
|
|||||||
postData.content = data.content;
|
postData.content = data.content;
|
||||||
postData.edited = now;
|
postData.edited = now;
|
||||||
postData.editor = data.uid;
|
postData.editor = data.uid;
|
||||||
plugins.fireHook('filter:post.edit', {post: postData, uid: data.uid}, next);
|
plugins.fireHook('filter:post.edit', {req: data.req, post: postData, uid: data.uid}, next);
|
||||||
},
|
},
|
||||||
function (result, next) {
|
function (result, next) {
|
||||||
postData = result.post;
|
postData = result.post;
|
||||||
@@ -128,9 +128,9 @@ module.exports = function(Posts) {
|
|||||||
data.tags = data.tags || [];
|
data.tags = data.tags || [];
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
async.apply(plugins.fireHook,'filter:topic.edit', topicData),
|
async.apply(plugins.fireHook, 'filter:topic.edit', {req: data.req, topic: topicData}),
|
||||||
function(topicData, next) {
|
function(results, next) {
|
||||||
db.setObject('topic:' + tid, topicData, next);
|
db.setObject('topic:' + tid, results.topicData, next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
topics.updateTags(tid, data.tags, next);
|
topics.updateTags(tid, data.tags, next);
|
||||||
|
|||||||
@@ -186,6 +186,7 @@ function authorize(socket, callback) {
|
|||||||
return next(err);
|
return next(err);
|
||||||
}
|
}
|
||||||
if (sessionData && sessionData.passport && sessionData.passport.user) {
|
if (sessionData && sessionData.passport && sessionData.passport.user) {
|
||||||
|
request.session = sessionData;
|
||||||
socket.uid = parseInt(sessionData.passport.user, 10);
|
socket.uid = parseInt(sessionData.passport.user, 10);
|
||||||
} else {
|
} else {
|
||||||
socket.uid = 0;
|
socket.uid = 0;
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ module.exports = function(SocketPosts) {
|
|||||||
title: data.title,
|
title: data.title,
|
||||||
content: data.content,
|
content: data.content,
|
||||||
topic_thumb: data.topic_thumb,
|
topic_thumb: data.topic_thumb,
|
||||||
tags: data.tags
|
tags: data.tags,
|
||||||
|
req: websockets.reqFromSocket(socket)
|
||||||
}, function(err, result) {
|
}, function(err, result) {
|
||||||
if (err) {
|
if (err) {
|
||||||
return callback(err);
|
return callback(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user