mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 14:30:57 +00:00
Merge pull request #125 from thelounge/astorije/124-fix-crash
Fix complete crash when refreshing a public instance
This commit is contained in:
commit
70de3de33a
1 changed files with 2 additions and 3 deletions
|
@ -8,7 +8,6 @@ var io = require("socket.io");
|
||||||
var Helper = require("./helper");
|
var Helper = require("./helper");
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
var sockets = null;
|
|
||||||
var manager = new ClientManager();
|
var manager = new ClientManager();
|
||||||
|
|
||||||
module.exports = function(options) {
|
module.exports = function(options) {
|
||||||
|
@ -43,7 +42,7 @@ module.exports = function(options) {
|
||||||
require("./identd").start(config.identd.port);
|
require("./identd").start(config.identd.port);
|
||||||
}
|
}
|
||||||
|
|
||||||
sockets = io(server, {
|
var sockets = io(server, {
|
||||||
transports: transports
|
transports: transports
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -182,7 +181,7 @@ function init(socket, client, token) {
|
||||||
function auth(data) {
|
function auth(data) {
|
||||||
var socket = this;
|
var socket = this;
|
||||||
if (config.public) {
|
if (config.public) {
|
||||||
var client = new Client(sockets);
|
var client = new Client(manager);
|
||||||
manager.clients.push(client);
|
manager.clients.push(client);
|
||||||
socket.on("disconnect", function() {
|
socket.on("disconnect", function() {
|
||||||
manager.clients = _.without(manager.clients, client);
|
manager.clients = _.without(manager.clients, client);
|
||||||
|
|
Loading…
Reference in a new issue