diff --git a/package.json b/package.json index 31add91..c650901 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "The self-hosted web IRC client", - "version": "0.38.6", + "version": "0.38.7", "author": "Mattias Erming", "preferGlobal": true, "bin": { diff --git a/src/client.js b/src/client.js index 67f1104..7cc339c 100644 --- a/src/client.js +++ b/src/client.js @@ -283,9 +283,14 @@ Client.prototype.sort = function(data) { }; Client.prototype.quit = function() { - this.sockets.in(this.id).sockets.forEach(function(socket) { - socket.disconnect(true); - }); + var sockets = this.sockets.sockets; + var room = sockets.adapter.rooms[this.id] || []; + for (var user in room) { + var socket = sockets.adapter.nsp.connected[user]; + if (socket) { + socket.disconnect(); + } + } this.networks.forEach(function(network) { var irc = network.irc; if (network.connected) {