Fixed topic command

This commit is contained in:
Mattias Erming 2014-04-06 20:04:11 +02:00
parent b5f85b422a
commit 57f4071f27
2 changed files with 7 additions and 9 deletions

View File

@ -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,

2
node_modules/slate-irc generated vendored

@ -1 +1 @@
Subproject commit 15d97807956b2e78f654e47586abf1f9e20ccf2a Subproject commit 5b023edd59244e3b8520d13f10785742e6c4b034