Add /part

This commit is contained in:
Simon Ser 2020-06-06 11:09:41 +02:00
parent e4a59aa3a8
commit 3612dd3e63
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -277,8 +277,20 @@ function executeCommand(s) {
break;
case "join":
var channel = args[0];
var msg = { command: "JOIN", params: [channel] };
sendMessage(msg);
if (!channel) {
console.error("Missing channel name");
return;
}
sendMessage({ command: "JOIN", params: [channel] });
break;
case "part":
// TODO: part reason
if (!activeBuffer || activeBuffer.readOnly) {
console.error("Not in a channel");
return;
}
var channel = activeBuffer.name;
sendMessage({ command: "PART", params: [channel] });
break;
default:
console.error("Unknwon command '" + cmd + "'");