Skip to content

Commit

Permalink
fix: messageId baileys
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidsonGomes committed Jun 12, 2024
1 parent fa14b7b commit a7887f0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/api/routes/chat.router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export class ChatRouter extends RouterBroker {

return res.status(HttpStatus.OK).json(response);
})
// TODO: realizar filtro pelo postgres corretamente
.post(this.routerPath('findMessages'), ...guards, async (req, res) => {
const response = await this.dataValidate<Query<Message>>({
request: req,
Expand Down
1 change: 1 addition & 0 deletions src/api/services/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class ChannelStartupService {

public setInstance(instance: InstanceDto) {
this.instance.name = instance.instanceName;
this.logger.setInstance(instance.instanceName);
this.instance.id = instance.instanceId;
this.instance.integration = instance.integration;
this.instance.number = instance.number;
Expand Down
2 changes: 2 additions & 0 deletions src/api/services/channels/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { Label } from '@whiskeysockets/baileys/lib/Types/Label';
import { LabelAssociation } from '@whiskeysockets/baileys/lib/Types/LabelAssociation';
import axios from 'axios';
import { isBase64, isURL } from 'class-validator';
import { randomBytes } from 'crypto';
import EventEmitter2 from 'eventemitter2';
// import { exec } from 'child_process';
import ffmpeg from 'fluent-ffmpeg';
Expand Down Expand Up @@ -1792,6 +1793,7 @@ export class BaileysStartupService extends ChannelStartupService {
const messageSent = await (async () => {
const option = {
quoted,
messageId: '3EB0' + randomBytes(6).toString('hex').toUpperCase(),
};

if (
Expand Down
3 changes: 0 additions & 3 deletions src/validate/validate.schema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
// Integrations Schema
// TODO: rever todas as integrações e garantir o funcionamento perfeito
export * from '../api/integrations/chatwoot/validate/chatwoot.schema';
export * from '../api/integrations/rabbitmq/validate/rabbitmq.schema';
export * from '../api/integrations/sqs/validate/sqs.schema';
export * from '../api/integrations/typebot/validate/typebot.schema';

// Instance Schema
export * from './chat.schema';
export * from './group.schema';
export * from './instance.schema';
Expand Down

0 comments on commit a7887f0

Please sign in to comment.