Skip to content

Commit

Permalink
load quoted message with unoId
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Oct 21, 2023
1 parent 16ca9ce commit 81cd0b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unoapi-cloud",
"version": "1.3.5",
"version": "1.3.6",
"description": "Unoapi Cloud",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion src/services/client_baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ export class ClientBaileys implements Client {
if (key?.id) {
const remoteJid = phoneNumberToJid(to)
quoted = await this.store?.dataStore.loadMessage(remoteJid, key?.id)
if (!quoted) {
const unoId = await this.store?.dataStore?.loadUnoId(key?.id)
if (unoId) {
quoted = await this.store?.dataStore.loadMessage(remoteJid, unoId)
}
}
logger.debug('Quoted message %s!', JSON.stringify(quoted))
}
}
Expand All @@ -373,7 +379,7 @@ export class ClientBaileys implements Client {
await toDelay(this.phone, to)
const response = await this.sendMessage(to, content, { composing: this.config.composingMessage, quoted, ...options })
if (response) {
logger.debug('Sent to baileys', response)
logger.debug('Sent to baileys %s', response)
const key = response.key
const ok = {
messaging_product: 'whatsapp',
Expand Down

0 comments on commit 81cd0b3

Please sign in to comment.