mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
messages-recv: DISABLE MESSAGE RESEND
This commit is contained in:
@@ -943,18 +943,20 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
const handleBadAck = async({ attrs }: BinaryNode) => {
|
const handleBadAck = async({ attrs }: BinaryNode) => {
|
||||||
const key: WAMessageKey = { remoteJid: attrs.from, fromMe: true, id: attrs.id }
|
const key: WAMessageKey = { remoteJid: attrs.from, fromMe: true, id: attrs.id }
|
||||||
// current hypothesis is that if pash is sent in the ack
|
|
||||||
// it means -- the message hasn't reached all devices yet
|
// WARNING: REFRAIN FROM ENABLING THIS FOR NOW. IT WILL CAUSE A LOOP
|
||||||
// we'll retry sending the message here
|
// // current hypothesis is that if pash is sent in the ack
|
||||||
if(attrs.phash) {
|
// // it means -- the message hasn't reached all devices yet
|
||||||
logger.info({ attrs }, 'received phash in ack, resending message...')
|
// // we'll retry sending the message here
|
||||||
const msg = await getMessage(key)
|
// if(attrs.phash) {
|
||||||
if(msg) {
|
// logger.info({ attrs }, 'received phash in ack, resending message...')
|
||||||
await relayMessage(key.remoteJid!, msg, { messageId: key.id!, useUserDevicesCache: false })
|
// const msg = await getMessage(key)
|
||||||
} else {
|
// if(msg) {
|
||||||
logger.warn({ attrs }, 'could not send message again, as it was not found')
|
// await relayMessage(key.remoteJid!, msg, { messageId: key.id!, useUserDevicesCache: false })
|
||||||
}
|
// } else {
|
||||||
}
|
// logger.warn({ attrs }, 'could not send message again, as it was not found')
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// error in acknowledgement,
|
// error in acknowledgement,
|
||||||
// device could not display the message
|
// device could not display the message
|
||||||
|
|||||||
Reference in New Issue
Block a user