Skip to content

Commit

Permalink
stream
Browse files Browse the repository at this point in the history
  • Loading branch information
KevLehman committed Oct 3, 2023
1 parent 43922e4 commit 68037ee
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions apps/meteor/server/modules/listeners/listeners.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
});
}
}
Empty file.
4 changes: 2 additions & 2 deletions apps/meteor/server/services/omnichannel/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ export class OmnichannelService extends ServiceClassInternal implements IOmnicha
});

License.onLimitReached('monthlyActiveContacts', async (): Promise<void> => {
void this.api?.broadcast('mac.LimitReached', {});
void this.api?.broadcast('mac.limitReached');
await this.queueWorker.stop();
});

License.onValidateLicense(async (): Promise<void> => {
void this.api?.broadcast('mac.limitRestored', {});
void this.api?.broadcast('mac.limitRestored');
await this.queueWorker.shouldStart();
});
}
Expand Down
1 change: 1 addition & 0 deletions ee/packages/ddp-client/src/types/streams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }] },
];

Expand Down

0 comments on commit 68037ee

Please sign in to comment.