Listening for events before 001 is sent
authorDarren <darren@Darrens-MacBook-Pro.local>
Tue, 23 Apr 2013 22:54:54 +0000 (23:54 +0100)
committerDarren <darren@Darrens-MacBook-Pro.local>
Tue, 23 Apr 2013 22:54:54 +0000 (23:54 +0100)
server/irc/connection.js

index 38230ab1b6f2303f9edfed4956f0eb65ae336c75..bfd2e23bfa23f866fbfe79e6eb2ab05e59f2a6e8 100644 (file)
@@ -52,7 +52,10 @@ var IrcConnection = function (hostname, port, ssl, nick, user, pass, state) {
     
     // IrcUser objects
     this.irc_users = Object.create(null);
-    
+
+    // TODO: use `this.nick` instead of `'*'` when using an IrcUser per nick
+    this.irc_users[this.nick] = new IrcUser(this, '*');
+
     // IrcChannel objects
     this.irc_channels = Object.create(null);
 
@@ -271,9 +274,6 @@ function onChannelJoin(event) {
 
 function onServerConnect(event) {
     this.nick = event.nick;
-
-    // TODO: use `event.nick` instead of `'*'` when using an IrcUser per nick
-    this.irc_users[event.nick] = new IrcUser(this, '*');
 }