fix: fast-path slash commands

This commit is contained in:
Peter Steinberger
2026-01-12 06:10:17 +00:00
parent 53e04968fe
commit 0f257f792a
5 changed files with 266 additions and 7 deletions

View File

@@ -610,6 +610,12 @@ export async function handleCommands(params: {
directives.hasStatusDirective ||
command.commandBodyNormalized === "/status";
if (allowTextCommands && statusRequested) {
if (!command.isAuthorizedSender) {
logVerbose(
`Ignoring /status from unauthorized sender: ${command.senderId || "<unknown>"}`,
);
return { shouldContinue: false };
}
const reply = await buildStatusReply({
cfg,
command,
@@ -632,6 +638,12 @@ export async function handleCommands(params: {
const whoamiRequested = command.commandBodyNormalized === "/whoami";
if (allowTextCommands && whoamiRequested) {
if (!command.isAuthorizedSender) {
logVerbose(
`Ignoring /whoami from unauthorized sender: ${command.senderId || "<unknown>"}`,
);
return { shouldContinue: false };
}
const senderId = ctx.SenderId ?? "";
const senderUsername = ctx.SenderUsername ?? "";
const lines = ["🧭 Identity", `Provider: ${command.provider}`];