fix: cannot send message on new Whatsapp Business limited accounts (#2080)
* fix: cannot send message on new Whatsapp Business limited accounts * chore: add woraround to resend the message on 475 errors * fix: lint * fix: add handler * fix: lint * Update src/Socket/messages-send.ts --------- Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
@@ -929,6 +929,19 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
logger.debug({ jid }, 'adding device identity')
|
||||
}
|
||||
|
||||
const contactTcTokenData =
|
||||
!isGroup && !isRetryResend && !isStatus ? await authState.keys.get('contacts-tc-token', [destinationJid]) : {}
|
||||
|
||||
const tcTokenBuffer = contactTcTokenData[destinationJid]?.token
|
||||
|
||||
if (tcTokenBuffer) {
|
||||
(stanza.content as BinaryNode[]).push({
|
||||
tag: 'tctoken',
|
||||
attrs: {},
|
||||
content: tcTokenBuffer
|
||||
})
|
||||
}
|
||||
|
||||
if (additionalNodes && additionalNodes.length > 0) {
|
||||
;(stanza.content as BinaryNode[]).push(...additionalNodes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user