mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
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:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user