fix disconnect error when using sendPresenceUpdate with LID (#1545)

* chore: change version web

* fix: enhance pairing response validation and adjust HMAC handling for hosted devices

* refactor: remove unused 'from' attribute in chatstate message

* feat: update chatstate message to conditionally set 'from' attribute based on server type
This commit is contained in:
Wender Teixeira
2025-06-24 17:51:46 -03:00
committed by GitHub
parent 8b6ea34b07
commit 83a6956b44

View File

@@ -44,6 +44,7 @@ import {
BinaryNode,
getBinaryNodeChild,
getBinaryNodeChildren,
jidDecode,
jidNormalizedUser,
reduceBinaryNodeToDictionary,
S_WHATSAPP_NET
@@ -637,10 +638,13 @@ export const makeChatsSocket = (config: SocketConfig) => {
}
})
} else {
const { server } = jidDecode(toJid)!
const isLid = server === 'lid'
await sendNode({
tag: 'chatstate',
attrs: {
from: me.id,
from: isLid ? me.lid! : me.id,
to: toJid!
},
content: [