fix: gate reset auth and infer whatsapp sender

This commit is contained in:
Peter Steinberger
2026-01-06 02:23:50 +01:00
parent b85248bd07
commit b6ae376076
3 changed files with 28 additions and 5 deletions

View File

@@ -173,6 +173,7 @@ export async function handleCommands(params: {
shouldContinue: boolean;
}> {
const {
ctx,
cfg,
command,
directives,
@@ -193,6 +194,18 @@ export async function handleCommands(params: {
isGroup,
} = params;
const resetRequested =
command.commandBodyNormalized === "/reset" ||
command.commandBodyNormalized === "reset" ||
command.commandBodyNormalized === "/new" ||
command.commandBodyNormalized === "new";
if (resetRequested && !command.isAuthorizedSender) {
logVerbose(
`Ignoring /reset from unauthorized sender: ${command.senderE164 || "<unknown>"}`,
);
return { shouldContinue: false };
}
const activationCommand = parseActivationCommand(
command.commandBodyNormalized,
);