mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-28 18:26:19 -05:00
Fix /me failing in user query buffers
This is a regression.
This commit is contained in:
parent
2546d31af0
commit
0c0f0ab79e
1 changed files with 10 additions and 2 deletions
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…
Reference in a new issue