Showing IRC disconnections to the user #81
[KiwiIRC.git] / server / irc / state.js
index 4f3f764de839f58e3628dbc495c382e46387d1f1..bcd062ac27cf4d4cc0b47ade9debd8367c2760a4 100755 (executable)
@@ -73,6 +73,9 @@ State.prototype.connect = function (hostname, port, ssl, nick, user, pass, callb
     });
 
     con.on('close', function () {
+        // TODO: Can we get a better reason for the disconnection? Was it planned?
+        that.sendIrcCommand('disconnect', {server: con.con_num, reason: 'disconnected'});
+
         that.irc_connections[con_num] = null;
         global.servers.removeConnection(this);
     });