mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
@@ -75,20 +75,15 @@ function onConnection(socket) {
|
||||
}
|
||||
|
||||
function onConnect(socket) {
|
||||
user.exists(socket.uid, function (err, exists) {
|
||||
if (err) {
|
||||
return winston.error(err);
|
||||
}
|
||||
if (socket.uid && exists) {
|
||||
socket.join('uid_' + socket.uid);
|
||||
socket.join('online_users');
|
||||
} else {
|
||||
socket.join('online_guests');
|
||||
}
|
||||
if (socket.uid) {
|
||||
socket.join('uid_' + socket.uid);
|
||||
socket.join('online_users');
|
||||
} else {
|
||||
socket.join('online_guests');
|
||||
}
|
||||
|
||||
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
|
||||
io.sockets.sockets[socket.id].emit('checkSession', socket.uid, exists);
|
||||
});
|
||||
socket.join('sess_' + socket.request.signedCookies[nconf.get('sessionKey')]);
|
||||
io.sockets.sockets[socket.id].emit('checkSession', socket.uid);
|
||||
}
|
||||
|
||||
function onMessage(socket, payload) {
|
||||
|
||||
Reference in New Issue
Block a user