forked from CringeStudios/gamja
/mode: use active buffer if omitted
This commit is contained in:
parent
a0c85c3372
commit
e2e2f7a8fc
@ -93,6 +93,14 @@ export default {
|
|||||||
usage: "<target> <modes> [mode args...]",
|
usage: "<target> <modes> [mode args...]",
|
||||||
description: "Change channel or user mode",
|
description: "Change channel or user mode",
|
||||||
execute: (app, args) => {
|
execute: (app, args) => {
|
||||||
|
var target = args[0];
|
||||||
|
if (target.startsWith("+") || target.startsWith("-")) {
|
||||||
|
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
|
||||||
|
if (!activeBuffer || !app.isChannel(activeBuffer.name)) {
|
||||||
|
throw new Error("Not in a channel");
|
||||||
|
}
|
||||||
|
args = [activeBuffer.name, ...args];
|
||||||
|
}
|
||||||
getActiveClient(app).send({ command: "MODE", params: args });
|
getActiveClient(app).send({ command: "MODE", params: args });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user