Revert "fix(whatsapp): allow per-message link preview override\n\nWhatsApp messages default to enabling link previews for URLs. This adds\nsupport for overriding this behavior per-message via the \nparameter (e.g. from tool options), consistent with Telegram.\n\nFix: Updated internal WhatsApp Web API layers to pass option\ndown to Baileys ."

This reverts commit 1bef2fc68b.
This commit is contained in:
Sebastian
2026-02-16 22:59:37 -05:00
parent 67014228cf
commit 65fa529e03
6 changed files with 9 additions and 97 deletions

View File

@@ -21,7 +21,6 @@ export async function sendMessageWhatsApp(
mediaLocalRoots?: readonly string[];
gifPlayback?: boolean;
accountId?: string;
linkPreview?: boolean;
},
): Promise<{ messageId: string; toJid: string }> {
let text = body;
@@ -76,14 +75,10 @@ export async function sendMessageWhatsApp(
const hasExplicitAccountId = Boolean(options.accountId?.trim());
const accountId = hasExplicitAccountId ? resolvedAccountId : undefined;
const sendOptions: ActiveWebSendOptions | undefined =
options.gifPlayback ||
options.accountId ||
options.linkPreview !== undefined ||
documentFileName
options.gifPlayback || accountId || documentFileName
? {
...(options.gifPlayback ? { gifPlayback: true } : {}),
...(documentFileName ? { fileName: documentFileName } : {}),
...(options.linkPreview !== undefined ? { linkPreview: options.linkPreview } : {}),
accountId,
}
: undefined;