diff --git a/lib/server.js b/lib/server.js index b305ed5..f6d5945 100644 --- a/lib/server.js +++ b/lib/server.js @@ -138,10 +138,11 @@ function input(json) { break; case "topic": - if (client && args[1]) { - var str = "TOPIC " + args[1]; - if (args[2]) { - str += " :" + args.slice(2).join(" "); + var chan = channel.get("name"); + if (client) { + var str = "TOPIC " + chan; + if (args[1]) { + str += " :" + args.slice(1).join(" "); } client.write(str); } @@ -290,10 +291,7 @@ function event(event, data) { case "topic": var chan = channels.findWhere({name: data[0].channel}); - var from = data[0].nick; - if (from == this.get("client").me) { - from = data[0].channel; - } + var from = data[0].nick || chan.get("name"); chan.addMessage({ from: from, message: data[0].topic, diff --git a/node_modules/slate-irc b/node_modules/slate-irc index 15d9780..5b023ed 160000 --- a/node_modules/slate-irc +++ b/node_modules/slate-irc @@ -1 +1 @@ -Subproject commit 15d97807956b2e78f654e47586abf1f9e20ccf2a +Subproject commit 5b023edd59244e3b8520d13f10785742e6c4b034