Skip to content

Commit

Permalink
notification message without timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
clairton committed Jun 11, 2024
1 parent a8a89a2 commit 3d34135
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 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.15.62",
"version": "1.15.63",
"description": "Unoapi Cloud",
"exports": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
3 changes: 0 additions & 3 deletions src/services/client_baileys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export class ClientBaileys implements Client {
message: {
conversation: text,
},
messageTimestamp: Math.floor(new Date().getTime() / 1000),
}
logger.debug('onNotification %s', JSON.stringify(payload))
if (this.config.sessionWebhook) {
Expand All @@ -169,7 +168,6 @@ export class ClientBaileys implements Client {

private onQrCode: OnQrCode = async (qrCode: string, time, limit) => {
logger.debug('Received qrcode %s %s', this.phone, qrCode)
const messageTimestamp = Math.floor(new Date().getTime() / 1000)
const id = uuid()
const qrCodeUrl = await QRCode.toDataURL(qrCode)
const remoteJid = phoneNumberToJid(this.phone)
Expand All @@ -188,7 +186,6 @@ export class ClientBaileys implements Client {
caption: `Please, read the QR Code to connect on Whatsapp Web, attempt ${time} of ${limit}`,
},
},
messageTimestamp,
}
if (this.config.sessionWebhook) {
const body = JSON.stringify({ info: { phone: this.phone }, status: await getSessionStatus(this.phone), ...waMessage })
Expand Down
5 changes: 1 addition & 4 deletions src/services/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,7 @@ export const fromBaileysMessageContent = (phone: string, payload: any, config?:
profileName = payload.verifiedBizName || payload.pushName || senderPhone
}
let cloudApiStatus
let messageTimestamp = payload.messageTimestamp
if (!messageTimestamp) {
messageTimestamp = Math.floor(Date.now() / 1000)
}
let messageTimestamp = payload.messageTimestamp || ''
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const groupMetadata: any = {}
if (payload.groupMetadata) {
Expand Down

0 comments on commit 3d34135

Please sign in to comment.