Merge pull request #537 from Nachx639/fix/discord-web-provider-activity
fix: Discord eventQueue + WhatsApp provider activity accounting
This commit is contained in:
commit
e4cd03033a
@ -134,6 +134,7 @@
|
||||
- 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
|
||||
- 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
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ import { DEFAULT_ACCOUNT_ID } from "../routing/session-key.js";
|
||||
|
||||
export type ActiveWebSendOptions = {
|
||||
gifPlayback?: boolean;
|
||||
accountId?: string;
|
||||
};
|
||||
|
||||
export type ActiveWebListener = {
|
||||
|
||||
@ -585,9 +585,10 @@ export async function monitorWebInbox(options: {
|
||||
payload = { text };
|
||||
}
|
||||
const result = await sock.sendMessage(jid, payload);
|
||||
const accountId = sendOptions?.accountId ?? options.accountId;
|
||||
recordProviderActivity({
|
||||
provider: "whatsapp",
|
||||
accountId: options.accountId,
|
||||
accountId,
|
||||
direction: "outbound",
|
||||
});
|
||||
return { messageId: result?.key?.id ?? "unknown" };
|
||||
|
||||
@ -69,9 +69,13 @@ export async function sendMessageWhatsApp(
|
||||
);
|
||||
if (!active) throw new Error("Active web listener missing");
|
||||
await active.sendComposingTo(to);
|
||||
const sendOptions: ActiveWebSendOptions | undefined = options.gifPlayback
|
||||
? { gifPlayback: true }
|
||||
: undefined;
|
||||
const sendOptions: ActiveWebSendOptions | undefined =
|
||||
options.gifPlayback || options.accountId
|
||||
? {
|
||||
...(options.gifPlayback ? { gifPlayback: true } : {}),
|
||||
accountId: options.accountId,
|
||||
}
|
||||
: undefined;
|
||||
const result = sendOptions
|
||||
? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions)
|
||||
: await active.sendMessage(to, text, mediaBuffer, mediaType);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user