From 7ddbf9764b051647e8ec380cebac0afca432da44 Mon Sep 17 00:00:00 2001 From: Darren Date: Wed, 10 Jul 2013 15:48:01 +0100 Subject: [PATCH] Don't auto connect an IRC connection in the constructor --- server/irc/connection.js | 6 ------ server/irc/state.js | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) 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 () { -- 2.25.1