Update encode.ts

This commit is contained in:
Rajeh Taher
2023-10-01 14:57:13 +03:00
committed by GitHub
parent a32c626583
commit 6c1fd75789

View File

@@ -52,10 +52,10 @@ export const encodeBinaryNode = (
pushBytes(bytes)
}
const writeJid = ({ agent, device, user, server }: FullJid) => {
const writeJid = ({ domainType, device, user, server }: FullJid) => {
if(typeof agent !== 'undefined' || typeof device !== 'undefined') {
pushByte(TAGS.AD_JID)
pushByte(agent || 0)
pushByte(domainType || 0)
pushByte(device || 0)
writeString(user)
} else {
@@ -233,4 +233,4 @@ export const encodeBinaryNode = (
}
return Buffer.from(buffer)
}
}