Skip to content

Commit

Permalink
feat: update dependencies and improve channel services
Browse files Browse the repository at this point in the history
Updated dependencies in package.json to ensure compatibility and performance. Enhanced functionality in channel.service.ts and whatsapp.baileys.service.ts for better service handling and reliability. This update aims to improve overall system stability and performance.
  • Loading branch information
DavidsonGomes committed Jun 18, 2024
1 parent 4349959 commit 4120318
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@
"join": "^3.0.0",
"js-yaml": "^4.1.0",
"jsonschema": "^1.4.1",
"jsonwebtoken": "^9.0.2",
"libphonenumber-js": "^1.10.39",
"link-preview-js": "^3.0.4",
"node-cache": "^5.1.2",
"node-mime-types": "^1.1.0",
Expand All @@ -100,7 +98,6 @@
"@types/cors": "^2.8.13",
"@types/express": "^4.17.17",
"@types/js-yaml": "^4.0.5",
"@types/jsonwebtoken": "^8.5.9",
"@types/mime-types": "^2.1.1",
"@types/node": "^18.15.11",
"@types/node-windows": "^0.1.2",
Expand Down
6 changes: 4 additions & 2 deletions src/api/services/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,9 @@ export class ChannelStartupService {
autoDelete: false,
});

const queueName = `${this.instanceName}.${event}`;
const eventName = event.replace(/_/g, '.').toLowerCase();

const queueName = `${this.instanceName}.${eventName}`;

await amqp.assertQueue(queueName, {
durable: true,
Expand All @@ -601,7 +603,7 @@ export class ChannelStartupService {
},
});

await amqp.bindQueue(queueName, exchangeName, event);
await amqp.bindQueue(queueName, exchangeName, eventName);

const message = {
event,
Expand Down
2 changes: 1 addition & 1 deletion src/api/services/channels/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ export class BaileysStartupService extends ChannelStartupService {
if (events['presence.update']) {
const payload = events['presence.update'];

if (settings.groupsIgnore && payload.id.includes('@g.us')) {
if (settings?.groupsIgnore && payload.id.includes('@g.us')) {
return;
}
this.sendDataWebhook(Events.PRESENCE_UPDATE, payload);
Expand Down

0 comments on commit 4120318

Please sign in to comment.