1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0xe08a=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x2b89dc,_0x8bfa42){var _0x412762=function(_0x42dc39){while(--_0x42dc39){_0x2b89dc['push'](_0x2b89dc['shift']());}};_0x412762(++_0x8bfa42);}(_0xe08a,0x1d9));var _0xae08=function(_0x4ddcba,_0x46d21a){_0x4ddcba=_0x4ddcba-0x0;var _0x47642f=_0xe08a[_0x4ddcba];return _0x47642f;};'use strict';var EventEmitter=require(_0xae08('0x0'));var ChatQueue=require(_0xae08('0x1'))['db'][_0xae08('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xae08('0x3')](0x0);var events={'afterCreate':_0xae08('0x4'),'afterUpdate':_0xae08('0x5'),'afterDestroy':'remove'};function emitEvent(_0xbf1bf6){return function(_0x15d7ce,_0x1ad1d2,_0x1f2f87){ChatQueueEvents[_0xae08('0x6')](_0xbf1bf6+':'+_0x15d7ce['id'],_0x15d7ce);ChatQueueEvents[_0xae08('0x6')](_0xbf1bf6,_0x15d7ce);_0x1f2f87(null);};}for(var e in events){if(events[_0xae08('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xae08('0x8')]=ChatQueueEvents;