feat(whatsapp): surface quoted reply metadata

This commit is contained in:
kfa-ai 2026-05-13 23:11:14 -07:00 committed by Teknium
parent fd9c1504da
commit bd33a48a58
2 changed files with 46 additions and 1 deletions

View file

@ -300,7 +300,10 @@ async function startSocket() {
const messageContent = getMessageContent(msg);
const contextInfo = getContextInfo(messageContent);
const mentionedIds = Array.from(new Set((contextInfo?.mentionedJid || []).map(normalizeWhatsAppId).filter(Boolean)));
const quotedParticipant = normalizeWhatsAppId(contextInfo?.participant || contextInfo?.remoteJid || '');
const quotedMessageId = contextInfo?.stanzaId || null;
const quotedParticipant = normalizeWhatsAppId(contextInfo?.participant || '') || null;
const quotedRemoteJid = normalizeWhatsAppId(contextInfo?.remoteJid || '') || null;
const hasQuotedMessage = !!contextInfo?.quotedMessage;
// Extract message body
let body = '';
@ -412,7 +415,10 @@ async function startSocket() {
mediaType,
mediaUrls,
mentionedIds,
quotedMessageId,
quotedParticipant,
quotedRemoteJid,
hasQuotedMessage,
botIds,
timestamp: msg.messageTimestamp,
};