mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-24 16:29:51 +01:00
closes #5613
This commit is contained in:
@@ -191,11 +191,13 @@ app.cacheBuster = null;
|
||||
if (!socket) {
|
||||
return;
|
||||
}
|
||||
var previousRoom = app.currentRoom;
|
||||
app.currentRoom = '';
|
||||
socket.emit('meta.rooms.leaveCurrent', function (err) {
|
||||
if (err) {
|
||||
app.currentRoom = previousRoom;
|
||||
return app.alertError(err.message);
|
||||
}
|
||||
app.currentRoom = '';
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ define('forum/topic/postTools', [
|
||||
|
||||
socket.emit(method, {
|
||||
pid: pid,
|
||||
room_id: app.currentRoom,
|
||||
room_id: 'topic_' + ajaxify.data.tid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
app.alertError(err.message);
|
||||
|
||||
@@ -67,7 +67,7 @@ define('forum/topic/votes', ['components', 'translator'], function (components,
|
||||
|
||||
socket.emit(currentState ? 'posts.unvote' : method, {
|
||||
pid: post.attr('data-pid'),
|
||||
room_id: app.currentRoom,
|
||||
room_id: 'topic_' + ajaxify.data.tid,
|
||||
}, function (err) {
|
||||
if (err) {
|
||||
if (err.message === 'self-vote') {
|
||||
|
||||
@@ -14,10 +14,14 @@ helpers.postCommand = function (socket, command, eventName, notification, data,
|
||||
return callback(new Error('[[error:not-logged-in]]'));
|
||||
}
|
||||
|
||||
if (!data || !data.pid || !data.room_id) {
|
||||
if (!data || !data.pid) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
if (!data.room_id) {
|
||||
return callback(new Error('[[error:invalid-room-id, ' + data.room_id + ' ]]'));
|
||||
}
|
||||
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
async.parallel({
|
||||
|
||||
Reference in New Issue
Block a user