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 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
|
||||
// we'll retry sending the message here
|
||||
if(attrs.phash) {
|
||||
logger.info({ attrs }, 'received phash in ack, resending message...')
|
||||
const msg = await getMessage(key)
|
||||
if(msg) {
|
||||
await relayMessage(key.remoteJid!, msg, { messageId: key.id!, useUserDevicesCache: false })
|
||||
} else {
|
||||
logger.warn({ attrs }, 'could not send message again, as it was not found')
|
||||
}
|
||||
}
|
||||
|
||||
// WARNING: REFRAIN FROM ENABLING THIS FOR NOW. IT WILL CAUSE A LOOP
|
||||
// // current hypothesis is that if pash is sent in the ack
|
||||
// // it means -- the message hasn't reached all devices yet
|
||||
// // we'll retry sending the message here
|
||||
// if(attrs.phash) {
|
||||
// logger.info({ attrs }, 'received phash in ack, resending message...')
|
||||
// const msg = await getMessage(key)
|
||||
// if(msg) {
|
||||
// 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,
|
||||
// device could not display the message
|
||||
|
||||
Reference in New Issue
Block a user