removed event:connect use socket.io connect event duh

v1.18.x
barisusakli 9 years ago
parent ceaa3a334d
commit bac2a0d959

@ -26,8 +26,6 @@ app.isConnected = false;
setTimeout(socket.connect.bind(socket), parseInt(config.reconnectionDelay, 10) * 10);
});
socket.on('event:connect', onEventConnect);
socket.on('event:disconnect', onEventDisconnect);
socket.on('event:banned', onEventBanned);
@ -37,6 +35,12 @@ app.isConnected = false;
socket.on('event:alert', app.alert);
function onSocketConnect() {
if (!reconnecting) {
app.showLoginMessage();
$(window).trigger('action:connected');
app.isConnected = true;
}
if (reconnecting) {
var reconnectEl = $('#reconnect');
@ -104,13 +108,6 @@ app.isConnected = false;
});
}
function onEventConnect() {
app.showLoginMessage();
app.replaceSelfLinks();
$(window).trigger('action:connected');
app.isConnected = true;
}
function onEventDisconnect() {
$(window).trigger('action:disconnected');
app.isConnected = false;

@ -71,14 +71,12 @@ function onConnect(socket) {
return;
}
socket.emit('event:connect');
if (userData.status !== 'offline') {
socket.broadcast.emit('event:user_status_change', {uid: socket.uid, status: userData.status || 'online'});
}
});
} else {
rooms.enter(socket, 'online_guests');
socket.emit('event:connect');
}
}

Loading…
Cancel
Save