mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-27 17:10:41 +00:00
fix(feishu): add reactionNotifications mode gating (openclaw#29388) thanks @Takhoffman
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -177,6 +177,12 @@ export async function resolveReactionSyntheticEvent(
|
||||
return null;
|
||||
}
|
||||
|
||||
const account = resolveFeishuAccount({ cfg, accountId });
|
||||
const reactionNotifications = account.config.reactionNotifications ?? "own";
|
||||
if (reactionNotifications === "off") {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Skip bot self-reactions
|
||||
if (event.operator_type === "app" || senderId === botOpenId) {
|
||||
return null;
|
||||
@@ -187,9 +193,7 @@ export async function resolveReactionSyntheticEvent(
|
||||
return null;
|
||||
}
|
||||
|
||||
// Fail closed if bot identity cannot be resolved; otherwise reactions on any
|
||||
// message can leak into the agent.
|
||||
if (!botOpenId) {
|
||||
if (reactionNotifications === "own" && !botOpenId) {
|
||||
logger?.(
|
||||
`feishu[${accountId}]: bot open_id unavailable, skipping reaction ${emoji} on ${messageId}`,
|
||||
);
|
||||
@@ -201,7 +205,7 @@ export async function resolveReactionSyntheticEvent(
|
||||
verificationTimeoutMs,
|
||||
).catch(() => null);
|
||||
const isBotMessage = reactedMsg?.senderType === "app" || reactedMsg?.senderOpenId === botOpenId;
|
||||
if (!reactedMsg || !isBotMessage) {
|
||||
if (!reactedMsg || (reactionNotifications === "own" && !isBotMessage)) {
|
||||
logger?.(
|
||||
`feishu[${accountId}]: ignoring reaction on non-bot/unverified message ${messageId} ` +
|
||||
`(sender: ${reactedMsg?.senderOpenId ?? "unknown"})`,
|
||||
|
||||
Reference in New Issue
Block a user