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 _0x5430=['exports','../../mysqldb','setMaxListeners','remove','emit','hook'];(function(_0x3f6d5a,_0x2a83c8){var _0x33b363=function(_0x2da4c2){while(--_0x2da4c2){_0x3f6d5a['push'](_0x3f6d5a['shift']());}};_0x33b363(++_0x2a83c8);}(_0x5430,0xc7));var _0x0543=function(_0x4a9874,_0x48f997){_0x4a9874=_0x4a9874-0x0;var _0x26b791=_0x5430[_0x4a9874];return _0x26b791;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0543('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0543('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0543('0x2')};function emitEvent(_0x50274e){return function(_0x5cce70,_0x3b4e30,_0x377152){ChatQueueEvents['emit'](_0x50274e+':'+_0x5cce70['id'],_0x5cce70);ChatQueueEvents[_0x0543('0x3')](_0x50274e,_0x5cce70);_0x377152(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0543('0x4')](e,emitEvent(event));}}module[_0x0543('0x5')]=ChatQueueEvents;