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:
comadreja
2026-06-18 00:08:42 +08:00
committed by Xubin Ren
parent 3f41605ddc
commit 51bd3337ef
+8
View File
@@ -181,6 +181,14 @@ export class WhatsAppClient {
const msgTimestamp = msg.messageTimestamp as number;
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);
if (!unwrapped) continue;