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 _0xf4ac=['events','../../mysqldb','ChatQueue','remove','emit','hasOwnProperty','hook','exports'];(function(_0x15ef53,_0x191ced){var _0x365dd6=function(_0x30ce32){while(--_0x30ce32){_0x15ef53['push'](_0x15ef53['shift']());}};_0x365dd6(++_0x191ced);}(_0xf4ac,0xd0));var _0xcf4a=function(_0x3c5941,_0x401298){_0x3c5941=_0x3c5941-0x0;var _0x5dc4a3=_0xf4ac[_0x3c5941];return _0x5dc4a3;};'use strict';var EventEmitter=require(_0xcf4a('0x0'));var ChatQueue=require(_0xcf4a('0x1'))['db'][_0xcf4a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xcf4a('0x3')};function emitEvent(_0x585f4b){return function(_0x2c2bf2,_0x337e92,_0x325127){ChatQueueEvents[_0xcf4a('0x4')](_0x585f4b+':'+_0x2c2bf2['id'],_0x2c2bf2);ChatQueueEvents[_0xcf4a('0x4')](_0x585f4b,_0x2c2bf2);_0x325127(null);};}for(var e in events){if(events[_0xcf4a('0x5')](e)){var event=events[e];ChatQueue[_0xcf4a('0x6')](e,emitEvent(event));}}module[_0xcf4a('0x7')]=ChatQueueEvents;