mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
no rooms.enter for anons check tid on topic enter
This commit is contained in:
@@ -63,20 +63,23 @@ SocketMeta.getUsageStats = function(socket, data, callback) {
|
||||
/* Rooms */
|
||||
|
||||
SocketMeta.rooms.enter = function(socket, data, callback) {
|
||||
if (!socket.uid) {
|
||||
return;
|
||||
}
|
||||
if (!data) {
|
||||
return callback(new Error('[[error:invalid-data]]'));
|
||||
}
|
||||
|
||||
if (data.leave) {
|
||||
socket.leave(data.leave);
|
||||
if (socket.uid && data.leave.indexOf('topic') !== -1) {
|
||||
if (data.leave.indexOf('topic') !== -1) {
|
||||
websockets.in(data.leave).emit('event:user_leave', socket.uid);
|
||||
}
|
||||
}
|
||||
|
||||
if (data.enter) {
|
||||
socket.join(data.enter);
|
||||
if (socket.uid && data.enter.indexOf('topic') !== -1) {
|
||||
if (data.enter.indexOf('topic') !== -1) {
|
||||
data.uid = socket.uid;
|
||||
websockets.in(data.enter).emit('event:user_enter', data);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ SocketTopics.post = function(socket, data, callback) {
|
||||
};
|
||||
|
||||
SocketTopics.enter = function(socket, tid, callback) {
|
||||
if (!tid || !socket.uid) {
|
||||
if (!parseInt(tid, 10) || !socket.uid) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user