}
}],
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] != ""))
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));
}
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);
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);