From: Darren Date: Wed, 10 Jul 2013 14:48:01 +0000 (+0100) Subject: Don't auto connect an IRC connection in the constructor X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=7ddbf9764b051647e8ec380cebac0afca432da44;p=KiwiIRC.git Don't auto connect an IRC connection in the constructor --- diff --git a/server/irc/connection.js b/server/irc/connection.js index 2c9ad82..df9b5b9 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -92,12 +92,6 @@ var IrcConnection = function (hostname, port, ssl, nick, user, pass, state) { this.held_data = ''; this.applyIrcEvents(); - - // Call any modules before making the connection - global.modules.emit('irc connecting', {connection: this}) - .done(function () { - that.connect(); - }); }; util.inherits(IrcConnection, EE); diff --git a/server/irc/state.js b/server/irc/state.js index 368684e..776ab5d 100755 --- a/server/irc/state.js +++ b/server/irc/state.js @@ -80,6 +80,12 @@ State.prototype.connect = function (hostname, port, ssl, nick, user, pass, callb that.irc_connections[con_num] = null; global.servers.removeConnection(this); }); + + // Call any modules before making the connection + global.modules.emit('irc connecting', {connection: con}) + .done(function () { + con.connect(); + }); }; State.prototype.sendIrcCommand = function () {