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 _0x19d4=['remove','emit','hasOwnProperty','hook','exports','setMaxListeners','save','update'];(function(_0x37d792,_0x4e63d9){var _0x511e7a=function(_0x1238f9){while(--_0x1238f9){_0x37d792['push'](_0x37d792['shift']());}};_0x511e7a(++_0x4e63d9);}(_0x19d4,0x1a5));var _0x419d=function(_0x48be95,_0x59f11e){_0x48be95=_0x48be95-0x0;var _0x32e215=_0x19d4[_0x48be95];return _0x32e215;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x419d('0x0')](0x0);var events={'afterCreate':_0x419d('0x1'),'afterUpdate':_0x419d('0x2'),'afterDestroy':_0x419d('0x3')};function emitEvent(_0xe9f332){return function(_0x556f2b,_0x1738ce,_0x1643de){ChatQueueEvents[_0x419d('0x4')](_0xe9f332+':'+_0x556f2b['id'],_0x556f2b);ChatQueueEvents[_0x419d('0x4')](_0xe9f332,_0x556f2b);_0x1643de(null);};}for(var e in events){if(events[_0x419d('0x5')](e)){var event=events[e];ChatQueue[_0x419d('0x6')](e,emitEvent(event));}}module[_0x419d('0x7')]=ChatQueueEvents;