forked from CringeStudios/gamja
Fix /me failing in user query buffers
This is a regression.
This commit is contained in:
parent
2546d31af0
commit
0c0f0ab79e
12
commands.js
12
commands.js
@ -9,6 +9,14 @@ function getActiveClient(app) {
|
||||
return app.clients.get(buf.server);
|
||||
}
|
||||
|
||||
function getActiveTarget(app) {
|
||||
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
|
||||
if (!activeBuffer) {
|
||||
throw new Error("Not in a buffer");
|
||||
}
|
||||
return activeBuffer.name;
|
||||
}
|
||||
|
||||
function getActiveChannel(app) {
|
||||
var activeBuffer = app.state.buffers.get(app.state.activeBuffer);
|
||||
if (!activeBuffer || activeBuffer.type !== BufferType.CHANNEL) {
|
||||
@ -173,9 +181,9 @@ export default {
|
||||
description: "Send an action message to the current buffer",
|
||||
execute: (app, args) => {
|
||||
var action = args.join(" ");
|
||||
var activeChannel = getActiveChannel(app);
|
||||
var target = getActiveTarget(app);
|
||||
var text = `\x01ACTION ${action}\x01`;
|
||||
app.privmsg(activeChannel, text);
|
||||
app.privmsg(target, text);
|
||||
},
|
||||
},
|
||||
"mode": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user