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 _0x439f=['save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x14bdd1,_0x4e9148){var _0x4123b7=function(_0x3d0eaa){while(--_0x3d0eaa){_0x14bdd1['push'](_0x14bdd1['shift']());}};_0x4123b7(++_0x4e9148);}(_0x439f,0x196));var _0xf439=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0x439f[_0x22e47a];return _0x15a12a;};'use strict';var EventEmitter=require(_0xf439('0x0'));var ChatQueue=require(_0xf439('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf439('0x2'),'afterUpdate':_0xf439('0x3'),'afterDestroy':_0xf439('0x4')};function emitEvent(_0x229b16){return function(_0x6d160c,_0x1eda5a,_0x4c775b){ChatQueueEvents['emit'](_0x229b16+':'+_0x6d160c['id'],_0x6d160c);ChatQueueEvents[_0xf439('0x5')](_0x229b16,_0x6d160c);_0x4c775b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xf439('0x6')](e,emitEvent(event));}}module[_0xf439('0x7')]=ChatQueueEvents;