feat(bridge): send read receipts (blue ticks) for incoming messages
Mark each incoming WhatsApp message as read via sock.readMessages() right after the startup-timestamp filter. Wrapped in try/catch so a failed receipt never blocks message processing.
This commit is contained in:
@@ -181,6 +181,14 @@ export class WhatsAppClient {
|
|||||||
const msgTimestamp = msg.messageTimestamp as number;
|
const msgTimestamp = msg.messageTimestamp as number;
|
||||||
if (msgTimestamp && msgTimestamp < startupTimestamp) continue;
|
if (msgTimestamp && msgTimestamp < startupTimestamp) continue;
|
||||||
|
|
||||||
|
// Send read receipt (blue check) immediately
|
||||||
|
try {
|
||||||
|
await this.sock!.readMessages([msg.key]);
|
||||||
|
} catch (e) {
|
||||||
|
// Non-fatal: log but don't block message processing
|
||||||
|
console.error('Failed to send read receipt:', (e as Error).message);
|
||||||
|
}
|
||||||
|
|
||||||
const unwrapped = baileysExtractMessageContent(msg.message);
|
const unwrapped = baileysExtractMessageContent(msg.message);
|
||||||
if (!unwrapped) continue;
|
if (!unwrapped) continue;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user