mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:48:26 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -11,7 +11,9 @@ const CORE_MESSAGING_TOOLS = new Set(["sessions_send", "message"]);
|
||||
|
||||
// Provider docking: any plugin with `actions` opts into messaging tool handling.
|
||||
export function isMessagingTool(toolName: string): boolean {
|
||||
if (CORE_MESSAGING_TOOLS.has(toolName)) return true;
|
||||
if (CORE_MESSAGING_TOOLS.has(toolName)) {
|
||||
return true;
|
||||
}
|
||||
const providerId = normalizeChannelId(toolName);
|
||||
return Boolean(providerId && getChannelPlugin(providerId)?.actions);
|
||||
}
|
||||
@@ -21,13 +23,19 @@ export function isMessagingToolSendAction(
|
||||
args: Record<string, unknown>,
|
||||
): boolean {
|
||||
const action = typeof args.action === "string" ? args.action.trim() : "";
|
||||
if (toolName === "sessions_send") return true;
|
||||
if (toolName === "sessions_send") {
|
||||
return true;
|
||||
}
|
||||
if (toolName === "message") {
|
||||
return action === "send" || action === "thread-reply";
|
||||
}
|
||||
const providerId = normalizeChannelId(toolName);
|
||||
if (!providerId) return false;
|
||||
if (!providerId) {
|
||||
return false;
|
||||
}
|
||||
const plugin = getChannelPlugin(providerId);
|
||||
if (!plugin?.actions?.extractToolSend) return false;
|
||||
if (!plugin?.actions?.extractToolSend) {
|
||||
return false;
|
||||
}
|
||||
return Boolean(plugin.actions.extractToolSend({ args })?.to);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user