Allow findWebIrc() to modify user details
authorJack Allnutt <m2ys4u@Gmail.com>
Thu, 8 Nov 2012 19:23:55 +0000 (19:23 +0000)
committerJack Allnutt <m2ys4u@Gmail.com>
Thu, 8 Nov 2012 19:23:55 +0000 (19:23 +0000)
server/irc/connection.js

index 53a4dad19a3493d7ea81321fbc54ea439aaeb6df..34f0777a63e977580b9a7804a1c7319662c8bc2e 100644 (file)
@@ -93,7 +93,7 @@ var connect_handler = function () {
     };
 
     // Let the webirc/etc detection modify any required parameters
-    connect_data = findWebIrc(connect_data);
+    connect_data = findWebIrc.call(this, connect_data);
 
     // Send any initial data for webirc/etc
     if (connect_data.prepend_data) {
@@ -145,7 +145,7 @@ function findWebIrc(connect_data) {
     // Check if we need to pass the users IP as its username/ident
     if (ip_as_username && ip_as_username.indexOf(connect_data.irc_host.hostname) > -1) {
         // Get a hex value of the clients IP
-        connect_data.username = connect_data.user.address.split('.').map(function(i, idx){
+        this.user = connect_data.user.address.split('.').map(function(i, idx){
             return parseInt(i, 10).toString(16);
         }).join('');