Skip to content

Commit 728cd5e

Browse files
committed
fix: document WhatsApp read receipts toggle (#882) (thanks @chrisrodz)
1 parent 0fab14a commit 728cd5e

File tree

5 files changed

+73
-0
lines changed

5 files changed

+73
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- Browser: add Chrome extension relay takeover mode (toolbar button), plus `clawdbot browser extension install/path` and remote browser control via `clawdbot browser serve` + `browser.controlToken`.
2222
- CLI/Docs: add per-command CLI doc pages and link them from `clawdbot <command> --help`.
2323
- Browser: copy the installed Chrome extension path to clipboard after `clawdbot browser extension install/path`.
24+
- WhatsApp: add `channels.whatsapp.sendReadReceipts` to disable auto read receipts. (#882) — thanks @chrisrodz.
2425

2526
### Fixes
2627
- Browser: add tests for snapshot labels/efficient query params and labeled image responses.

docs/channels/telegram.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ group messages, so use admin if you need full visibility.
9393
- Multi-agent override: set per-agent patterns on `agents.list[].groupChat.mentionPatterns`.
9494
- Replies always route back to the same Telegram chat.
9595
- Long-polling uses grammY runner with per-chat sequencing; overall concurrency is capped by `agents.defaults.maxConcurrent`.
96+
- Telegram Bot API does not support read receipts; there is no `sendReadReceipts` option.
9697

9798
## Formatting (Telegram HTML)
9899
- Outbound Telegram text uses `parse_mode: "HTML"` (Telegram’s supported tag subset).

docs/channels/whatsapp.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,32 @@ Behavior:
138138
- Self-chat mode (allowFrom includes your number) avoids auto read receipts and ignores mention JIDs.
139139
- Read receipts sent for non-self-chat DMs.
140140

141+
## Read receipts
142+
By default, the gateway marks inbound WhatsApp messages as read (blue ticks) once they are accepted.
143+
144+
Disable globally:
145+
```json5
146+
{
147+
channels: { whatsapp: { sendReadReceipts: false } }
148+
}
149+
```
150+
151+
Disable per account:
152+
```json5
153+
{
154+
channels: {
155+
whatsapp: {
156+
accounts: {
157+
personal: { sendReadReceipts: false }
158+
}
159+
}
160+
}
161+
}
162+
```
163+
164+
Notes:
165+
- Self-chat mode always skips read receipts.
166+
141167
## WhatsApp FAQ: sending messages + pairing
142168

143169
**Will Clawdbot message random contacts when I link WhatsApp?**

docs/gateway/configuration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,22 @@ For groups, use `channels.whatsapp.groupPolicy` + `channels.whatsapp.groupAllowF
430430
}
431431
```
432432

433+
### `channels.whatsapp.sendReadReceipts`
434+
435+
Controls whether inbound WhatsApp messages are marked as read (blue ticks). Default: `true`.
436+
437+
Self-chat mode always skips read receipts, even when enabled.
438+
439+
Per-account override: `channels.whatsapp.accounts.<id>.sendReadReceipts`.
440+
441+
```json5
442+
{
443+
channels: {
444+
whatsapp: { sendReadReceipts: false }
445+
}
446+
}
447+
```
448+
433449
### `channels.whatsapp.accounts` (multi-account)
434450

435451
Run multiple WhatsApp accounts in one gateway:

src/web/monitor-inbox.blocks-messages-from-unauthorized-senders-not-allowfrom.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,35 @@ describe("web monitor inbox", () => {
210210
await listener.close();
211211
});
212212

213+
it("skips read receipts when disabled", async () => {
214+
const onMessage = vi.fn();
215+
const listener = await monitorWebInbox({
216+
verbose: false,
217+
onMessage,
218+
sendReadReceipts: false,
219+
});
220+
const sock = await createWaSocket();
221+
222+
const upsert = {
223+
type: "notify",
224+
messages: [
225+
{
226+
key: { id: "rr-off-1", fromMe: false, remoteJid: "[email protected]" },
227+
message: { conversation: "read receipts off" },
228+
messageTimestamp: 1_700_000_000,
229+
},
230+
],
231+
};
232+
233+
sock.ev.emit("messages.upsert", upsert);
234+
await new Promise((resolve) => setImmediate(resolve));
235+
236+
expect(onMessage).toHaveBeenCalledTimes(1);
237+
expect(sock.readMessages).not.toHaveBeenCalled();
238+
239+
await listener.close();
240+
});
241+
213242
it("lets group messages through even when sender not in allowFrom", async () => {
214243
mockLoadConfig.mockReturnValue({
215244
channels: { whatsapp: { allowFrom: ["+1234"], groupPolicy: "open" } },

0 commit comments

Comments
 (0)