Reading nick on welcome message fix
authorDarren <darren@darrenwhitlen.com>
Wed, 31 Aug 2011 19:31:09 +0000 (20:31 +0100)
committerDarren <darren@darrenwhitlen.com>
Wed, 31 Aug 2011 19:31:09 +0000 (20:31 +0100)
node/app.js

index e7bf40ab9ddb50c4a350b1ef1048d590a5e31e53..4cf93078511bf5657a8992e2d2cf9df78d8e2784 100644 (file)
@@ -134,9 +134,10 @@ this.parseIRCMessage = function (websocket, ircSocket, data) {
                 ircSocket.IRC.CAP.requested = [];
                 ircSocket.IRC.registered = true;
             }
-            regex = /([a-z0-9\x5B-\x60\x7B-\x7D\.\-]+)!([a-z0-9~\.\-_|]+)@?([a-z0-9\.\-:\/]+)/i;
-            matches = regex.exec(msg.trailing);
-            websocket.sendClientEvent('connect', {connected: true, host: null, nick: matches[1]});
+            //regex = /([a-z0-9\x5B-\x60\x7B-\x7D\.\-]+)!([a-z0-9~\.\-_|]+)@?([a-z0-9\.\-:\/]+)/i;
+            //matches = regex.exec(msg.trailing);
+            nick =  msg.params.split(' ')[0];
+            websocket.sendClientEvent('connect', {connected: true, host: null, nick: nick});
             break;
         case ircNumerics.RPL_ISUPPORT:
             opts = msg.params.split(" ");