mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix msg id override not being respected
This commit is contained in:
@@ -65,13 +65,13 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
if(participant) {
|
if(participant) {
|
||||||
node.attrs.participant = participant
|
node.attrs.participant = participant
|
||||||
}
|
}
|
||||||
messageIds = messageIds.slice(1)
|
const remainingMessageIds = messageIds.slice(1)
|
||||||
if(messageIds.length) {
|
if(remainingMessageIds.length) {
|
||||||
node.content = [
|
node.content = [
|
||||||
{
|
{
|
||||||
tag: 'list',
|
tag: 'list',
|
||||||
attrs: { },
|
attrs: { },
|
||||||
content: messageIds.map(id => ({
|
content: remainingMessageIds.map(id => ({
|
||||||
tag: 'item',
|
tag: 'item',
|
||||||
attrs: { id }
|
attrs: { id }
|
||||||
}))
|
}))
|
||||||
@@ -177,6 +177,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
const { user, server } = jidDecode(jid)
|
const { user, server } = jidDecode(jid)
|
||||||
const isGroup = server === 'g.us'
|
const isGroup = server === 'g.us'
|
||||||
msgId = msgId || generateMessageID()
|
msgId = msgId || generateMessageID()
|
||||||
|
|
||||||
const encodedMsg = encodeWAMessage(message)
|
const encodedMsg = encodeWAMessage(message)
|
||||||
const participants: BinaryNode[] = []
|
const participants: BinaryNode[] = []
|
||||||
let stanza: BinaryNode
|
let stanza: BinaryNode
|
||||||
@@ -381,7 +382,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
|||||||
upload: waUploadToServer
|
upload: waUploadToServer
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
await relayMessage(jid, fullMsg.message, options.messageId)
|
await relayMessage(jid, fullMsg.message, fullMsg.key.id!)
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
ev.emit('messages.upsert', { messages: [fullMsg], type: 'append' })
|
ev.emit('messages.upsert', { messages: [fullMsg], type: 'append' })
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user