Fix bug causing users to disconnect

This commit is contained in:
Mattias Erming 2014-09-29 08:49:38 -07:00
parent 20f0ca6666
commit 9947b537b6
2 changed files with 9 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "shout", "name": "shout",
"description": "The self-hosted web IRC client", "description": "The self-hosted web IRC client",
"version": "0.38.6", "version": "0.38.7",
"author": "Mattias Erming", "author": "Mattias Erming",
"preferGlobal": true, "preferGlobal": true,
"bin": { "bin": {

View file

@ -283,9 +283,14 @@ Client.prototype.sort = function(data) {
}; };
Client.prototype.quit = function() { Client.prototype.quit = function() {
this.sockets.in(this.id).sockets.forEach(function(socket) { var sockets = this.sockets.sockets;
socket.disconnect(true); 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) { this.networks.forEach(function(network) {
var irc = network.irc; var irc = network.irc;
if (network.connected) { if (network.connected) {