mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: enable viewOnce messages to quote (#736)
This commit is contained in:
@@ -573,7 +573,8 @@ export const generateWAMessageFromContent = (
|
|||||||
options.timestamp = new Date()
|
options.timestamp = new Date()
|
||||||
}
|
}
|
||||||
|
|
||||||
const key = Object.keys(message)[0]
|
const innerMessage = normalizeMessageContent(message)!
|
||||||
|
const key: string = getContentType(innerMessage)!
|
||||||
const timestamp = unixTimestampSeconds(options.timestamp)
|
const timestamp = unixTimestampSeconds(options.timestamp)
|
||||||
const { quoted, userJid } = options
|
const { quoted, userJid } = options
|
||||||
|
|
||||||
@@ -590,7 +591,7 @@ export const generateWAMessageFromContent = (
|
|||||||
delete quotedContent.contextInfo
|
delete quotedContent.contextInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
const contextInfo: proto.IContextInfo = message[key].contextInfo || { }
|
const contextInfo: proto.IContextInfo = innerMessage[key].contextInfo || { }
|
||||||
contextInfo.participant = jidNormalizedUser(participant!)
|
contextInfo.participant = jidNormalizedUser(participant!)
|
||||||
contextInfo.stanzaId = quoted.key.id
|
contextInfo.stanzaId = quoted.key.id
|
||||||
contextInfo.quotedMessage = quotedMsg
|
contextInfo.quotedMessage = quotedMsg
|
||||||
@@ -601,7 +602,7 @@ export const generateWAMessageFromContent = (
|
|||||||
contextInfo.remoteJid = quoted.key.remoteJid
|
contextInfo.remoteJid = quoted.key.remoteJid
|
||||||
}
|
}
|
||||||
|
|
||||||
message[key].contextInfo = contextInfo
|
innerMessage[key].contextInfo = contextInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
if(
|
if(
|
||||||
@@ -612,8 +613,8 @@ export const generateWAMessageFromContent = (
|
|||||||
// already not converted to disappearing message
|
// already not converted to disappearing message
|
||||||
key !== 'ephemeralMessage'
|
key !== 'ephemeralMessage'
|
||||||
) {
|
) {
|
||||||
message[key].contextInfo = {
|
innerMessage[key].contextInfo = {
|
||||||
...(message[key].contextInfo || {}),
|
...(innerMessage[key].contextInfo || {}),
|
||||||
expiration: options.ephemeralExpiration || WA_DEFAULT_EPHEMERAL,
|
expiration: options.ephemeralExpiration || WA_DEFAULT_EPHEMERAL,
|
||||||
//ephemeralSettingTimestamp: options.ephemeralOptions.eph_setting_ts?.toString()
|
//ephemeralSettingTimestamp: options.ephemeralOptions.eph_setting_ts?.toString()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user