fix(auto-reply): preserve inline /status text for unauthorized senders
This commit is contained in:
@@ -489,6 +489,7 @@ export async function getReplyFromConfig(
|
|||||||
.filter((alias) => !reservedCommands.has(alias.toLowerCase()));
|
.filter((alias) => !reservedCommands.has(alias.toLowerCase()));
|
||||||
let parsedDirectives = parseInlineDirectives(commandSource, {
|
let parsedDirectives = parseInlineDirectives(commandSource, {
|
||||||
modelAliases: configuredAliases,
|
modelAliases: configuredAliases,
|
||||||
|
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||||
});
|
});
|
||||||
if (
|
if (
|
||||||
isGroup &&
|
isGroup &&
|
||||||
@@ -519,6 +520,7 @@ export async function getReplyFromConfig(
|
|||||||
if (noMentions.trim().length > 0) {
|
if (noMentions.trim().length > 0) {
|
||||||
const directiveOnlyCheck = parseInlineDirectives(noMentions, {
|
const directiveOnlyCheck = parseInlineDirectives(noMentions, {
|
||||||
modelAliases: configuredAliases,
|
modelAliases: configuredAliases,
|
||||||
|
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||||
});
|
});
|
||||||
if (directiveOnlyCheck.cleaned.trim().length > 0) {
|
if (directiveOnlyCheck.cleaned.trim().length > 0) {
|
||||||
const allowInlineStatus =
|
const allowInlineStatus =
|
||||||
@@ -552,6 +554,7 @@ export async function getReplyFromConfig(
|
|||||||
if (!sessionCtx.CommandBody && !sessionCtx.RawBody) {
|
if (!sessionCtx.CommandBody && !sessionCtx.RawBody) {
|
||||||
return parseInlineDirectives(existingBody, {
|
return parseInlineDirectives(existingBody, {
|
||||||
modelAliases: configuredAliases,
|
modelAliases: configuredAliases,
|
||||||
|
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||||
}).cleaned;
|
}).cleaned;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,6 +562,7 @@ export async function getReplyFromConfig(
|
|||||||
if (markerIndex < 0) {
|
if (markerIndex < 0) {
|
||||||
return parseInlineDirectives(existingBody, {
|
return parseInlineDirectives(existingBody, {
|
||||||
modelAliases: configuredAliases,
|
modelAliases: configuredAliases,
|
||||||
|
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||||
}).cleaned;
|
}).cleaned;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -571,6 +575,7 @@ export async function getReplyFromConfig(
|
|||||||
);
|
);
|
||||||
const cleanedTail = parseInlineDirectives(tail, {
|
const cleanedTail = parseInlineDirectives(tail, {
|
||||||
modelAliases: configuredAliases,
|
modelAliases: configuredAliases,
|
||||||
|
allowStatusDirective: allowTextCommands && command.isAuthorizedSender,
|
||||||
}).cleaned;
|
}).cleaned;
|
||||||
return `${head}${cleanedTail}`;
|
return `${head}${cleanedTail}`;
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user