feat(whatsapp): add sendReadReceipts config option
Add option to disable automatic read receipts for WhatsApp messages. When set to false, Clawdbot will not mark messages as read (blue ticks). Closes #344 Changes: - Add sendReadReceipts to WhatsAppConfig and WhatsAppAccountConfig types - Add sendReadReceipts to zod schemas for validation - Add sendReadReceipts to ResolvedWhatsAppAccount with fallback chain - Pass sendReadReceipts through to monitorWebInbox - Gate sock.readMessages() call based on config option Default behavior (true) is preserved - only explicitly setting false will disable read receipts.
This commit is contained in:
committed by
Peter Steinberger
parent
44a237b637
commit
7a683a4b62
@@ -14,6 +14,8 @@ export type WhatsAppConfig = {
|
||||
capabilities?: string[];
|
||||
/** Allow channel-initiated config writes (default: true). */
|
||||
configWrites?: boolean;
|
||||
/** Send read receipts for incoming messages (default true). */
|
||||
sendReadReceipts?: boolean;
|
||||
/**
|
||||
* Inbound message prefix (WhatsApp only).
|
||||
* Default: `[{agents.list[].identity.name}]` (or `[clawdbot]`) when allowFrom is empty, else `""`.
|
||||
@@ -84,6 +86,8 @@ export type WhatsAppAccountConfig = {
|
||||
configWrites?: boolean;
|
||||
/** If false, do not start this WhatsApp account provider. Default: true. */
|
||||
enabled?: boolean;
|
||||
/** Send read receipts for incoming messages (default true). */
|
||||
sendReadReceipts?: boolean;
|
||||
/** Inbound message prefix override for this account (WhatsApp only). */
|
||||
messagePrefix?: string;
|
||||
/** Override auth directory (Baileys multi-file auth state). */
|
||||
|
||||
@@ -13,6 +13,7 @@ export const WhatsAppAccountSchema = z
|
||||
capabilities: z.array(z.string()).optional(),
|
||||
configWrites: z.boolean().optional(),
|
||||
enabled: z.boolean().optional(),
|
||||
sendReadReceipts: z.boolean().optional(),
|
||||
messagePrefix: z.string().optional(),
|
||||
/** Override auth directory for this WhatsApp account (Baileys multi-file auth state). */
|
||||
authDir: z.string().optional(),
|
||||
@@ -62,6 +63,7 @@ export const WhatsAppConfigSchema = z
|
||||
accounts: z.record(z.string(), WhatsAppAccountSchema.optional()).optional(),
|
||||
capabilities: z.array(z.string()).optional(),
|
||||
configWrites: z.boolean().optional(),
|
||||
sendReadReceipts: z.boolean().optional(),
|
||||
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
||||
messagePrefix: z.string().optional(),
|
||||
selfChatMode: z.boolean().optional(),
|
||||
|
||||
Reference in New Issue
Block a user