mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
dont let joining other uid rooms
This commit is contained in:
@@ -54,10 +54,15 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
|
||||
if (!socket.uid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
if (data.enter && data.enter.startsWith('uid_') && data.enter !== 'uid_' + socket.uid) {
|
||||
return callback(new Error('[[error:not-allowed]]'));
|
||||
}
|
||||
|
||||
if (socket.currentRoom) {
|
||||
rooms.leave(socket, socket.currentRoom);
|
||||
if (socket.currentRoom.indexOf('topic') !== -1) {
|
||||
|
||||
Reference in New Issue
Block a user