]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Fix lowercase/uppercase queries/windows.
authorChris Porter <redacted>
Fri, 5 Dec 2008 00:19:49 +0000 (00:19 +0000)
committerChris Porter <redacted>
Fri, 5 Dec 2008 00:19:49 +0000 (00:19 +0000)
Don't allow /query to target windows.

TODO.txt
js/irc/commandparser.js
js/irc/ircclient.js
js/ui/baseui.js

index 62f7be66475c1712c254a1aa790bb37ea7c11ef0..667816634e847a4004ab4fb502ed2adff342340c 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -23,5 +23,5 @@ Options pane:
   \r
 Other:\r
   BUG: IE7 seems to be broke\r
-  BUG: Queries: upper/lowercase issues.\r
+\r
   
\ No newline at end of file
index 04070cd415c898bb45755407476a5f9c65bad15e..12ef4bd540fa79ea35bc9d9d236dcb94171e73ab 100644 (file)
@@ -179,6 +179,11 @@ qwebirc.irc.CommandParser = new Class({
     }
   }],
   cmd_QUERY: [false, 2, 1, function(args) {
+    if(this.parentObject.isChannel(args[0])) {
+      this.getActiveWindow().errorMessage("Can't target a channel with this command.");
+      return;
+    }
+
     this.parentObject.newWindow(args[0], qwebirc.ui.WINDOW_QUERY, true);
 
     if((args.length > 1) && (args[1] != ""))
index 47c83616e5c4947b38fa33e1da656adc401333a4..b6224be608c8e0f0c3f6b04f8bcfa251c3c575ec 100644 (file)
@@ -89,15 +89,15 @@ qwebirc.irc.IRCClient = new Class({
       w.updateNickList(sortednames);
   },
   getWindow: function(name) {
-    return this.windows[name];
+    return this.windows[name.toIRCLower()];
   },
   newWindow: function(name, type, select) {
     var w = this.getWindow(name);
     if(!w) {
-      w = this.windows[name] = this.ui.newWindow(this, type, name);
+      w = this.windows[name.toIRCLower()] = this.ui.newWindow(this, type, name);
       
       w.addEvent("close", function(w) {
-        delete this.windows[name];
+        delete this.windows[name.toIRCLower()];
       }.bind(this));
     }
     
@@ -106,13 +106,16 @@ qwebirc.irc.IRCClient = new Class({
       
     return w;
   },
+  getQueryWindow: function(name) {
+    return this.ui.getWindow(this, qwebirc.ui.WINDOW_QUERY, name);
+  },
   newQueryWindow: function(name) {
-    if(this.ui.uiOptions.DEDICATED_MSG_WINDOW)
+    if(this.ui.uiOptions.DEDICATED_MSG_WINDOW && !this.ui.getWindow(this, qwebirc.ui.WINDOW_MESSAGES) && !this.getQueryWindow(name))
       return this.ui.newWindow(this, qwebirc.ui.WINDOW_MESSAGES, "Messages");
     return this.newWindow(name, qwebirc.ui.WINDOW_QUERY, false);
   },
   newQueryLine: function(window, type, data, active) {
-    if(this.getWindow(window))
+    if(this.getQueryWindow(window))
       return this.newLine(window, type, data);
       
     var w = this.ui.getWindow(this, qwebirc.ui.WINDOW_MESSAGES);
index 6b2887f39051f7ff578faa569ad562b36af2289b..2e47e850af6fca12c0369ccba985924ca488b8d0 100644 (file)
@@ -56,7 +56,7 @@ qwebirc.ui.BaseUI = new Class({
       return "-M";
     if(type == qwebirc.ui.WINDOW_STATUS)
       return "";
-    return "_" + name;
+    return "_" + name.toIRCLower();
   },
   newWindow: function(client, type, name) {
     var w = this.getWindow(client, type, name);