From d1663315e3fb3c0864ac0ef90b68eef41dbcfd0b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 28 Jun 2020 09:32:03 +0200 Subject: [PATCH] Add reason arg to /part --- components/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/app.js b/components/app.js index c06d66a..ec1f732 100644 --- a/components/app.js +++ b/components/app.js @@ -428,13 +428,17 @@ export default class App extends Component { this.client.send({ command: "JOIN", params: [channel] }); break; case "part": - // TODO: part reason - if (!this.state.activeBuffer || !this.isChannel(this.state.activeBuffer)) { + var reason = args.join(" "); + var channel = this.state.activeBuffer; + if (!channel || !this.isChannel(channel)) { console.error("Not in a channel"); return; } - var channel = this.state.activeBuffer; - this.client.send({ command: "PART", params: [channel] }); + var params = [channel]; + if (reason) { + params.push(reason); + } + this.client.send({ command: "PART", params }); break; case "msg": var target = args[0];