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,
|
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: [
|
||||||
|
|||||||
Reference in New Issue
Block a user