mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying a better disconnect event
This commit is contained in:
@@ -374,6 +374,13 @@ module.exports = function() {
|
|||||||
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
socket.on("left_channel", function(msg) {
|
||||||
|
if(msg.hasOwnProperty("channel") && msg.channel != "" && typeof(msg.channel) == "string") {
|
||||||
|
coll = msg.channel;
|
||||||
|
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
socket.on('reconnect_failed', function()
|
socket.on('reconnect_failed', function()
|
||||||
{
|
{
|
||||||
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
List.left_channel(coll, guid, short_id, in_list, socket, false);
|
||||||
|
|||||||
@@ -536,6 +536,7 @@ var Channel = {
|
|||||||
var host = window.location.hostname.split(".");
|
var host = window.location.hostname.split(".");
|
||||||
window.location.hostname = host[host.length -1];
|
window.location.hostname = host[host.length -1];
|
||||||
}*/
|
}*/
|
||||||
|
var channel_before_move = chan.toLowerCase();
|
||||||
clearTimeout(timed_remove_check);
|
clearTimeout(timed_remove_check);
|
||||||
changing_to_frontpage = true;
|
changing_to_frontpage = true;
|
||||||
$.contextMenu( 'destroy', ".playlist-element" );
|
$.contextMenu( 'destroy', ".playlist-element" );
|
||||||
@@ -579,7 +580,10 @@ var Channel = {
|
|||||||
//socket.emit("change_channel");
|
//socket.emit("change_channel");
|
||||||
//removeAllListeners();
|
//removeAllListeners();
|
||||||
//socket.removeEventListener(id);
|
//socket.removeEventListener(id);
|
||||||
socket.disconnect();
|
socket.emit("left_channel", {
|
||||||
|
channel: channel_before_move
|
||||||
|
});
|
||||||
|
//socket.disconnect();
|
||||||
} else {
|
} else {
|
||||||
socket.removeEventListener("chat.all");
|
socket.removeEventListener("chat.all");
|
||||||
socket.removeEventListener("chat");
|
socket.removeEventListener("chat");
|
||||||
|
|||||||
Reference in New Issue
Block a user