From 9730dd0bdfe908ef51a286ee0e070f66998a4478 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Tue, 3 Oct 2023 13:30:05 -0600 Subject: [PATCH] stream --- apps/meteor/server/modules/listeners/listeners.module.ts | 8 ++++++++ apps/meteor/server/services/omnichannel/mac.ts | 0 apps/meteor/server/services/omnichannel/service.ts | 4 ++-- ee/packages/ddp-client/src/types/streams.ts | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) delete mode 100644 apps/meteor/server/services/omnichannel/mac.ts diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index f21081e43d0a1..ce2ee7de58998 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -471,5 +471,13 @@ export class ListenersModule { notifications.streamApps.emitWithoutBroadcast('actions/changed'); notifications.streamApps.emitWithoutBroadcast('apps', ['actions/changed', []]); }); + + service.onEvent('mac.limitReached', () => { + notifications.notifyLoggedInThisInstance('mac.limit', { limitReached: true }); + }); + + service.onEvent('mac.limitRestored', () => { + notifications.notifyLoggedInThisInstance('mac.limit', { limitReached: false }); + }); } } diff --git a/apps/meteor/server/services/omnichannel/mac.ts b/apps/meteor/server/services/omnichannel/mac.ts deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/apps/meteor/server/services/omnichannel/service.ts b/apps/meteor/server/services/omnichannel/service.ts index 58a894477c59f..5c705d4d35ac4 100644 --- a/apps/meteor/server/services/omnichannel/service.ts +++ b/apps/meteor/server/services/omnichannel/service.ts @@ -32,12 +32,12 @@ export class OmnichannelService extends ServiceClassInternal implements IOmnicha }); License.onLimitReached('monthlyActiveContacts', async (): Promise => { - void this.api?.broadcast('mac.LimitReached', {}); + void this.api?.broadcast('mac.limitReached'); await this.queueWorker.stop(); }); License.onValidateLicense(async (): Promise => { - void this.api?.broadcast('mac.limitRestored', {}); + void this.api?.broadcast('mac.limitRestored'); await this.queueWorker.shouldStart(); }); } diff --git a/ee/packages/ddp-client/src/types/streams.ts b/ee/packages/ddp-client/src/types/streams.ts index a32dec4705648..ceba1995b7d1d 100644 --- a/ee/packages/ddp-client/src/types/streams.ts +++ b/ee/packages/ddp-client/src/types/streams.ts @@ -235,6 +235,7 @@ export interface StreamerEvents { }, { key: 'voip.statuschanged'; args: [boolean] }, + { key: 'mac.limit'; args: [{ limitReached: boolean }] }, { key: 'omnichannel.priority-changed'; args: [{ id: string; clientAction: ClientAction; name?: string }] }, ];