diff --git a/CHANGELOG.md b/CHANGELOG.md index 427a412b..54f725cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Fixed * Fix looping connection messages in chatwoot +* Improved performance of fetch instances # 1.5.0 (2023-08-18 12:47) diff --git a/package.json b/package.json index 783731d7..6f179a53 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@figuro/chatwoot-sdk": "^1.1.14", "@hapi/boom": "^10.0.1", "@sentry/node": "^7.59.2", - "@whiskeysockets/baileys": "^6.4.1", + "@whiskeysockets/baileys": "^6.4.0", "amqplib": "^0.10.3", "axios": "^1.3.5", "class-validator": "^0.13.2", @@ -78,7 +78,8 @@ "sharp": "^0.30.7", "socket.io": "^4.7.1", "socks-proxy-agent": "^8.0.1", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "whatsapp-web.js": "^1.22.1" }, "devDependencies": { "@types/compression": "^1.7.2", diff --git a/src/whatsapp/services/whatsapp.service.ts b/src/whatsapp/services/whatsapp.service.ts index 33f62536..d0715717 100644 --- a/src/whatsapp/services/whatsapp.service.ts +++ b/src/whatsapp/services/whatsapp.service.ts @@ -1900,17 +1900,17 @@ export class WAStartupService { public async fetchProfile(instanceName: string, number?: string) { const jid = number ? this.createJid(number) : this.client?.user?.id; - + this.logger.verbose('Getting profile with jid: ' + jid); try { this.logger.verbose('Getting profile info'); - + if (number) { const info = (await this.whatsappNumber({ numbers: [jid] }))?.shift(); const picture = await this.profilePicture(info?.jid); const status = await this.getStatus(info?.jid); const business = await this.fetchBusinessProfile(info?.jid); - + return { wuid: info?.jid || jid, name: info?.name,