Implement /topic command

This commit is contained in:
Simon Ser 2020-07-09 17:36:28 +02:00
parent 44b1f28cb6
commit 5cb38a9830
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -526,6 +526,18 @@ export default class App extends Component {
}
this.switchBuffer(name);
break;
case "topic":
var channel = this.state.activeBuffer;
if (!channel || !this.isChannel(channel)) {
console.error("Not in a channel");
return;
}
var params = [channel];
if (args.length > 0) {
params.push(args.join(" "));
}
this.client.send({ command: "TOPIC", params });
break;
default:
console.error("Unknwon command '" + cmd + "'");
}