fix: only strip inline /status for allowlisted senders
This commit is contained in:
@@ -488,9 +488,10 @@ export async function getReplyFromConfig(
|
||||
.map((entry) => entry.alias?.trim())
|
||||
.filter((alias): alias is string => Boolean(alias))
|
||||
.filter((alias) => !reservedCommands.has(alias.toLowerCase()));
|
||||
const allowStatusDirective = allowTextCommands && command.isAuthorizedSender;
|
||||
let parsedDirectives = parseInlineDirectives(commandSource, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||
allowStatusDirective,
|
||||
});
|
||||
if (
|
||||
isGroup &&
|
||||
@@ -521,7 +522,7 @@ export async function getReplyFromConfig(
|
||||
if (noMentions.trim().length > 0) {
|
||||
const directiveOnlyCheck = parseInlineDirectives(noMentions, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||
allowStatusDirective,
|
||||
});
|
||||
if (directiveOnlyCheck.cleaned.trim().length > 0) {
|
||||
const allowInlineStatus =
|
||||
@@ -555,7 +556,7 @@ export async function getReplyFromConfig(
|
||||
if (!sessionCtx.CommandBody && !sessionCtx.RawBody) {
|
||||
return parseInlineDirectives(existingBody, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||
allowStatusDirective,
|
||||
}).cleaned;
|
||||
}
|
||||
|
||||
@@ -563,7 +564,7 @@ export async function getReplyFromConfig(
|
||||
if (markerIndex < 0) {
|
||||
return parseInlineDirectives(existingBody, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||
allowStatusDirective,
|
||||
}).cleaned;
|
||||
}
|
||||
|
||||
@@ -576,7 +577,7 @@ export async function getReplyFromConfig(
|
||||
);
|
||||
const cleanedTail = parseInlineDirectives(tail, {
|
||||
modelAliases: configuredAliases,
|
||||
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||
allowStatusDirective,
|
||||
}).cleaned;
|
||||
return `${head}${cleanedTail}`;
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user