fix(whatsapp): update reaction docs + suppress pairing for reactions

- Update docs: reaction removals now emit events with isRemoval=true
- Pass no-op sendMessage to access control to prevent pairing messages
  being sent when unknown users react (pairing is for messages, not reactions)

(Cursor review)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nick Sullivan 2026-01-29 12:53:31 -06:00
parent 273f3ca260
commit 79f799256d
2 changed files with 4 additions and 2 deletions

View File

@ -304,9 +304,10 @@ When someone reacts to a message in a WhatsApp chat, the gateway emits a system
```
WhatsApp reaction added: 👍 by +1234567890 msg BAE5ABC123
WhatsApp reaction removed by +1234567890 msg BAE5ABC123
```
- Reaction removals (empty emoji) are silently skipped.
- Reaction removals emit events with `isRemoval: true` and no emoji in the message.
- Self-reactions in DMs are correctly attributed to the bot's own JID.
- Group reactions include the participant who reacted.
- Events are deduplicated by message ID, sender, and emoji to avoid repeat notifications.

View File

@ -357,6 +357,7 @@ export async function monitorWebInbox(options: {
if (!isOwnReaction) {
const from = group ? chatJid : await resolveInboundJid(chatJid);
if (!from) continue;
// No-op sendMessage: reactions shouldn't trigger pairing replies
const access = await checkInboundAccessControl({
accountId: options.accountId,
from,
@ -365,7 +366,7 @@ export async function monitorWebInbox(options: {
group,
isFromMe: false,
connectedAtMs,
sock: { sendMessage: (jid, content) => sock.sendMessage(jid, content) },
sock: { sendMessage: async () => ({}) },
remoteJid: chatJid,
});
if (!access.allowed) {