Skip to content
Snippets Groups Projects
Commit d0a0a4ed authored by mcmlxxix's avatar mcmlxxix
Browse files

clear chat window on /clear

parent d4a7b874
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,12 @@ function JSONChat(usernum,jsonclient,host,port) {
var chan = this.channels[target.toUpperCase()];
this.client.write("chat","channels." + chan.name + ".history",[],2);
chan.messages = [];
}
if(this.view) {
var tab = this.view.getTab(target)
if(tab)
tab.frame.clear();
}
}
this.join = function(target,str) {
this.client.subscribe("chat","channels." + target + ".messages");
......@@ -146,12 +151,14 @@ function JSONChat(usernum,jsonclient,host,port) {
cmdstr = cmdstr.split(" ");
switch(cmdstr[0].toUpperCase()) {
case "J":
case "JOIN":
cmdstr.shift();
var chan = cmdstr.shift();
if(chan)
this.join(chan,cmdstr.join(" "));
break;
case "P":
case "PART":
cmdstr.shift();
var chan = cmdstr.shift();
......
......@@ -333,7 +333,7 @@ function LayoutView(title,frame,parent) {
this.getTab=function(title_or_index) {
if(isNaN(title_or_index)) {
for each(var t in properties.tabs) {
if(t.title.toUpperCase() == title.toUpperCase())
if(t.title.toUpperCase() == title_or_index.toUpperCase())
return t;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment