Skip to content

Commit

Permalink
compatilbe with chatwoot
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Oct 20, 2023
1 parent 10d130c commit 9e68d02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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.2",
"version": "1.3.3",
"description": "Unoapi Cloud",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/services/client_baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,9 @@ export class ClientBaileys implements Client {
content = toBaileysMessageContent(payload)
}
let quoted: WAMessage | undefined = undefined
if (payload?.context?.message_id) {
const key = await this.store?.dataStore?.loadKey(payload?.context?.message_id)
const messageId = payload?.context?.message_id || payload?.context?.id
if (messageId) {
const key = await this.store?.dataStore?.loadKey(messageId)
logger.debug('Quoted message %s!', key?.id)
if (key?.id) {
const remoteJid = phoneNumberToJid(to)
Expand Down
1 change: 1 addition & 0 deletions src/services/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ export const fromBaileysMessageContent = (phone: string, payload: any): any => {
if (binMessage?.contextInfo?.stanzaId) {
message.context = {
message_id: binMessage?.contextInfo?.stanzaId,
id: binMessage?.contextInfo?.stanzaId,
}
}
change.value.messages.push(message)
Expand Down

0 comments on commit 9e68d02

Please sign in to comment.