fix: align WhatsApp activity account id (#537) (thanks @Nachx639)

This commit is contained in:
Peter Steinberger
2026-01-09 20:42:35 +01:00
parent a05c4fca5c
commit a65455e25d
3 changed files with 11 additions and 5 deletions

View File

@@ -134,6 +134,7 @@
- Config: fix Minimax hosted onboarding to write `agents.defaults` and allow `msteams` as a heartbeat target. — thanks @steipete - Config: fix Minimax hosted onboarding to write `agents.defaults` and allow `msteams` as a heartbeat target. — thanks @steipete
- Discord: add channel/category management actions (create/edit/move/delete + category removal). (#487) - thanks @NicholasSpisak - Discord: add channel/category management actions (create/edit/move/delete + category removal). (#487) - thanks @NicholasSpisak
- Docs: split CLI install commands into separate code blocks. (#601) — thanks @martinpucik - Docs: split CLI install commands into separate code blocks. (#601) — thanks @martinpucik
- WhatsApp: record outbound provider activity using the active account id. (#537) — thanks @Nachx639
## 2026.1.8 ## 2026.1.8

View File

@@ -585,9 +585,10 @@ export async function monitorWebInbox(options: {
payload = { text }; payload = { text };
} }
const result = await sock.sendMessage(jid, payload); const result = await sock.sendMessage(jid, payload);
const accountId = sendOptions?.accountId ?? options.accountId;
recordProviderActivity({ recordProviderActivity({
provider: "whatsapp", provider: "whatsapp",
accountId: options?.accountId, accountId,
direction: "outbound", direction: "outbound",
}); });
return { messageId: result?.key?.id ?? "unknown" }; return { messageId: result?.key?.id ?? "unknown" };
@@ -610,7 +611,7 @@ export async function monitorWebInbox(options: {
}); });
recordProviderActivity({ recordProviderActivity({
provider: "whatsapp", provider: "whatsapp",
accountId: options?.accountId, accountId: options.accountId,
direction: "outbound", direction: "outbound",
}); });
return { messageId: result?.key?.id ?? "unknown" }; return { messageId: result?.key?.id ?? "unknown" };

View File

@@ -69,9 +69,13 @@ export async function sendMessageWhatsApp(
); );
if (!active) throw new Error("Active web listener missing"); if (!active) throw new Error("Active web listener missing");
await active.sendComposingTo(to); await active.sendComposingTo(to);
const sendOptions: ActiveWebSendOptions | undefined = options.gifPlayback const sendOptions: ActiveWebSendOptions | undefined =
? { gifPlayback: true } options.gifPlayback || options.accountId
: undefined; ? {
...(options.gifPlayback ? { gifPlayback: true } : {}),
accountId: options.accountId,
}
: undefined;
const result = sendOptions const result = sendOptions
? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions) ? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions)
: await active.sendMessage(to, text, mediaBuffer, mediaType); : await active.sendMessage(to, text, mediaBuffer, mediaType);