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:
parent
273f3ca260
commit
79f799256d
@ -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 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.
|
- Self-reactions in DMs are correctly attributed to the bot's own JID.
|
||||||
- Group reactions include the participant who reacted.
|
- Group reactions include the participant who reacted.
|
||||||
- Events are deduplicated by message ID, sender, and emoji to avoid repeat notifications.
|
- Events are deduplicated by message ID, sender, and emoji to avoid repeat notifications.
|
||||||
|
|||||||
@ -357,6 +357,7 @@ export async function monitorWebInbox(options: {
|
|||||||
if (!isOwnReaction) {
|
if (!isOwnReaction) {
|
||||||
const from = group ? chatJid : await resolveInboundJid(chatJid);
|
const from = group ? chatJid : await resolveInboundJid(chatJid);
|
||||||
if (!from) continue;
|
if (!from) continue;
|
||||||
|
// No-op sendMessage: reactions shouldn't trigger pairing replies
|
||||||
const access = await checkInboundAccessControl({
|
const access = await checkInboundAccessControl({
|
||||||
accountId: options.accountId,
|
accountId: options.accountId,
|
||||||
from,
|
from,
|
||||||
@ -365,7 +366,7 @@ export async function monitorWebInbox(options: {
|
|||||||
group,
|
group,
|
||||||
isFromMe: false,
|
isFromMe: false,
|
||||||
connectedAtMs,
|
connectedAtMs,
|
||||||
sock: { sendMessage: (jid, content) => sock.sendMessage(jid, content) },
|
sock: { sendMessage: async () => ({}) },
|
||||||
remoteJid: chatJid,
|
remoteJid: chatJid,
|
||||||
});
|
});
|
||||||
if (!access.allowed) {
|
if (!access.allowed) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user