From 6b4dce897db1776309c7e3d0042a1dd06987e4d9 Mon Sep 17 00:00:00 2001 From: Cassio Santos Date: Wed, 11 Jun 2025 08:39:19 -0300 Subject: [PATCH] feat: add lid to message key (#1510) * feat: add lid to message key * chore: review suggestion --- src/Types/Message.ts | 2 +- src/Utils/decode-wa-message.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Types/Message.ts b/src/Types/Message.ts index c465241..21bbe88 100644 --- a/src/Types/Message.ts +++ b/src/Types/Message.ts @@ -13,7 +13,7 @@ export type WAMessage = proto.IWebMessageInfo export type WAMessageContent = proto.IMessage export type WAContactMessage = proto.Message.IContactMessage export type WAContactsArrayMessage = proto.Message.IContactsArrayMessage -export type WAMessageKey = proto.IMessageKey +export type WAMessageKey = proto.IMessageKey & { senderLid?: string; participantLid?: string; senderPn?: string } export type WATextMessage = proto.Message.IExtendedTextMessage export type WAContextInfo = proto.IContextInfo export type WALocationMessage = proto.Message.ILocationMessage diff --git a/src/Utils/decode-wa-message.ts b/src/Utils/decode-wa-message.ts index 0f9a7b5..59dbaab 100644 --- a/src/Utils/decode-wa-message.ts +++ b/src/Utils/decode-wa-message.ts @@ -110,7 +110,10 @@ export function decodeMessageNode(stanza: BinaryNode, meId: string, meLid: strin remoteJid: chatId, fromMe, id: msgId, - participant + senderLid: stanza?.attrs?.sender_lid, + senderPn: stanza?.attrs?.sender_pn, + participant, + participantLid: stanza?.attrs?.participant_lid } const fullMessage: proto.IWebMessageInfo = {