mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: do not throw error on missing message for retry
This commit is contained in:
@@ -477,21 +477,17 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
config.getMessage({ ...key, id })
|
config.getMessage({ ...key, id })
|
||||||
))
|
))
|
||||||
)
|
)
|
||||||
const missingMsgIdx = msgs.findIndex(m => !m)
|
|
||||||
if(missingMsgIdx >= 0) {
|
|
||||||
throw new Boom(
|
|
||||||
`recv request to retry message, but message "${ids[missingMsgIdx]}" not available`,
|
|
||||||
{ statusCode: 404, data: { key } }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
for(let i = 0; i < msgs.length;i++) {
|
for(let i = 0; i < msgs.length;i++) {
|
||||||
await relayMessage(key.remoteJid, msgs[i], {
|
if(msgs[i]) {
|
||||||
messageId: ids[i],
|
await relayMessage(key.remoteJid, msgs[i], {
|
||||||
participant
|
messageId: ids[i],
|
||||||
})
|
participant
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
logger.debug({ jid: key.remoteJid, id: ids[i] }, 'recv retry request, but message not available')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReceipt = async(node: BinaryNode) => {
|
const handleReceipt = async(node: BinaryNode) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user