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