backport to 0.6.x

This commit is contained in:
Barış Soner Uşaklı
2015-05-14 13:56:12 -04:00
parent 7682b56d78
commit a1f49f6ccf

View File

@@ -57,6 +57,10 @@ SocketMeta.rooms.enter = function(socket, data, callback) {
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) {
socket.leave(socket.currentRoom);
if (socket.currentRoom.indexOf('topic') !== -1) {