mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
separated the sockets.emit to socket.emit + broadcast so OP gets action right away. moved callback sooner.
This commit is contained in:
@@ -36,7 +36,16 @@ SocketPosts.reply = function(socket, data, callback) {
|
||||
'topics:reply': true
|
||||
};
|
||||
|
||||
websockets.server.sockets.emit('event:new_post', {
|
||||
callback();
|
||||
|
||||
socket.emit('event:new_post', {
|
||||
posts: [postData],
|
||||
privileges: privileges,
|
||||
'reputation:disabled': parseInt(meta.config['reputation:disabled'], 10) === 1,
|
||||
'downvote:disabled': parseInt(meta.config['downvote:disabled'], 10) === 1,
|
||||
});
|
||||
|
||||
socket.broadcast.emit('event:new_post', {
|
||||
posts: [postData],
|
||||
privileges: privileges,
|
||||
'reputation:disabled': parseInt(meta.config['reputation:disabled'], 10) === 1,
|
||||
@@ -45,8 +54,6 @@ SocketPosts.reply = function(socket, data, callback) {
|
||||
|
||||
module.parent.exports.emitTopicPostStats();
|
||||
topics.pushUnreadCount();
|
||||
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user