Naming IrcConnection event handlers in State
authorDarren <darren@darrenwhitlen.com>
Fri, 2 Aug 2013 11:08:43 +0000 (12:08 +0100)
committerDarren <darren@darrenwhitlen.com>
Fri, 2 Aug 2013 11:08:43 +0000 (12:08 +0100)
server/irc/state.js

index 67d8351beb4e290a8311b5c7d04d07c7e341fa1a..77ad4cb031ee7be5d946357cc8eabcd30da588d8 100755 (executable)
@@ -59,17 +59,17 @@ State.prototype.connect = function (hostname, port, ssl, nick, user, pass, callb
 
     this.irc_connections[con_num] = con;
 
-    con.on('connected', function () {
+    con.on('connected', function IrcConnectionConnection() {
         global.servers.addConnection(this);
         return callback(null, con_num);
     });
 
-    con.on('error', function (err) {
+    con.on('error', function IrcConnectionError(err) {
         console.log('irc_connection error (' + hostname + '):', err);
         return callback(err.code, {server: con_num, error: err});
     });
 
-    con.on('close', function () {
+    con.on('close', function IrcConnectionClose() {
         // TODO: Can we get a better reason for the disconnection? Was it planned?
         that.sendIrcCommand('disconnect', {server: con.con_num, reason: 'disconnected'});