Fixed topic command
This commit is contained in:
parent
b5f85b422a
commit
57f4071f27
|
@ -138,10 +138,11 @@ function input(json) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "topic":
|
case "topic":
|
||||||
if (client && args[1]) {
|
var chan = channel.get("name");
|
||||||
var str = "TOPIC " + args[1];
|
if (client) {
|
||||||
if (args[2]) {
|
var str = "TOPIC " + chan;
|
||||||
str += " :" + args.slice(2).join(" ");
|
if (args[1]) {
|
||||||
|
str += " :" + args.slice(1).join(" ");
|
||||||
}
|
}
|
||||||
client.write(str);
|
client.write(str);
|
||||||
}
|
}
|
||||||
|
@ -290,10 +291,7 @@ function event(event, data) {
|
||||||
|
|
||||||
case "topic":
|
case "topic":
|
||||||
var chan = channels.findWhere({name: data[0].channel});
|
var chan = channels.findWhere({name: data[0].channel});
|
||||||
var from = data[0].nick;
|
var from = data[0].nick || chan.get("name");
|
||||||
if (from == this.get("client").me) {
|
|
||||||
from = data[0].channel;
|
|
||||||
}
|
|
||||||
chan.addMessage({
|
chan.addMessage({
|
||||||
from: from,
|
from: from,
|
||||||
message: data[0].topic,
|
message: data[0].topic,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 15d97807956b2e78f654e47586abf1f9e20ccf2a
|
Subproject commit 5b023edd59244e3b8520d13f10785742e6c4b034
|
Loading…
Reference in New Issue