From 6945d404871c3af20eff5dd4bcc3d59ebcfa09d6 Mon Sep 17 00:00:00 2001 From: Andy Graulund Date: Sat, 8 Apr 2017 13:06:17 +0200 Subject: [PATCH 1/2] More connection-related events --- lib/irc.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/irc.js b/lib/irc.js index 23ccfe08..3f18ad8e 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -743,6 +743,7 @@ Client.prototype.connect = function(retryCount, callback) { } var self = this; self.chans = {}; + self.emit('connecting'); // socket opts var connectionOpts = { @@ -857,10 +858,12 @@ Client.prototype.connect = function(retryCount, callback) { self.conn.addListener('end', function() { if (self.opt.debug) util.log('Connection got "end" event'); + self.emit('end'); }); self.conn.addListener('close', function() { if (self.opt.debug) util.log('Connection got "close" event'); + self.emit('close'); if (self.conn && self.conn.requestedDisconnect) return; From ecbd4b99ecdf7ddfe3e2fed69f5a300527d216e7 Mon Sep 17 00:00:00 2001 From: Andy Graulund Date: Sat, 8 Apr 2017 18:05:44 +0200 Subject: [PATCH 2/2] Removed connecting event that did not really do much --- lib/irc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/irc.js b/lib/irc.js index 3f18ad8e..e5c75e09 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -743,7 +743,6 @@ Client.prototype.connect = function(retryCount, callback) { } var self = this; self.chans = {}; - self.emit('connecting'); // socket opts var connectionOpts = {