From: Chris Porter Date: Sat, 11 Apr 2009 21:23:46 +0000 (+0100) Subject: Refactor RFC1459 case handling functions and their callers, as a consequence fixing... X-Git-Url: https://jfr.im/git/irc/quakenet/qwebirc.git/commitdiff_plain/fd3734d4adff434df08316f80ca6637797f9899b Refactor RFC1459 case handling functions and their callers, as a consequence fixing channel tab completion. --- diff --git a/js/irc/baseircclient.js b/js/irc/baseircclient.js index e5fd5d6..008160b 100644 --- a/js/irc/baseircclient.js +++ b/js/irc/baseircclient.js @@ -28,7 +28,8 @@ qwebirc.irc.BaseIRCClient = new Class({ this.send = this.connection.send.bind(this.connection); this.connect = this.connection.connect.bind(this.connection); this.disconnect = this.connection.disconnect.bind(this.connection); - + + this.toIRCLower = qwebirc.irc.RFC1459toIRCLower; this.setupGenericErrors(); }, dispatch: function(data) { diff --git a/js/irc/ircclient.js b/js/irc/ircclient.js index 589651b..f37cb6d 100644 --- a/js/irc/ircclient.js +++ b/js/irc/ircclient.js @@ -73,10 +73,10 @@ qwebirc.irc.IRCClient = new Class({ if(nc.prefixes.length > 0) { var c = nc.prefixes.charAt(0); - nx = String.fromCharCode(this.prefixes.indexOf(c)) + n.toIRCLower(); + nx = String.fromCharCode(this.prefixes.indexOf(c)) + this.toIRCLower(n); nh[nx] = c + n; } else { - nx = tff + n.toIRCLower(); + nx = tff + this.toIRCLower(n); nh[nx] = n; } names.push(nx); @@ -94,15 +94,15 @@ qwebirc.irc.IRCClient = new Class({ w.updateNickList(sortednames); }, getWindow: function(name) { - return this.windows[name.toIRCLower()]; + return this.windows[this.toIRCLower(name)]; }, newWindow: function(name, type, select) { var w = this.getWindow(name); if(!w) { - w = this.windows[name.toIRCLower()] = this.ui.newWindow(this, type, name); + w = this.windows[this.toIRCLower(name)] = this.ui.newWindow(this, type, name); w.addEvent("close", function(w) { - delete this.windows[name.toIRCLower()]; + delete this.windows[this.toIRCLower(name)]; }.bind(this)); } diff --git a/js/irc/irclib.js b/js/irc/irclib.js index 7bd93c3..99e0614 100644 --- a/js/irc/irclib.js +++ b/js/irc/irclib.js @@ -33,9 +33,7 @@ qwebirc.irc.IRCLowerTable = [ /* xf8-xff */ '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff' ]; -String.prototype.toIRCLower = function() { - var x = this; - +qwebirc.irc.RFC1459toIRCLower = function(x) { var p = []; for(var i=0;i