mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-02-05 23:06:26 -06:00
fix: websocket emit
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { EventDto } from '@api/integrations/event/event.dto';
|
|
||||||
import { PrismaRepository } from '@api/repository/repository.service';
|
import { PrismaRepository } from '@api/repository/repository.service';
|
||||||
import { WAMonitoringService } from '@api/services/monitor.service';
|
import { WAMonitoringService } from '@api/services/monitor.service';
|
||||||
import { configService, Cors, Log, Websocket } from '@config/env.config';
|
import { configService, Cors, Log, Websocket } from '@config/env.config';
|
||||||
@@ -95,13 +94,13 @@ export class WebsocketController extends EventController implements EventControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const instance = (await this.get(instanceName)) as EventDto;
|
const instance = await this.get(instanceName);
|
||||||
|
|
||||||
if (!instance?.websocket?.enabled) {
|
if (!instance?.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Array.isArray(instance?.websocket.events) && instance?.websocket.events.includes(configEv)) {
|
if (Array.isArray(instance?.events) && instance?.events.includes(configEv)) {
|
||||||
this.socket.of(`/${instanceName}`).emit(event, message);
|
this.socket.of(`/${instanceName}`).emit(event, message);
|
||||||
|
|
||||||
if (logEnabled) {
|
if (logEnabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user