diff --git a/lib/irc.js b/lib/irc.js index 23ccfe08..e5c75e09 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -857,10 +857,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;