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 _0xfb93=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','ChatQueue'];(function(_0x2fe5b9,_0x127e48){var _0x6f874=function(_0x23f8e7){while(--_0x23f8e7){_0x2fe5b9['push'](_0x2fe5b9['shift']());}};_0x6f874(++_0x127e48);}(_0xfb93,0x115));var _0x3fb9=function(_0x4880fc,_0x407738){_0x4880fc=_0x4880fc-0x0;var _0x22d8e8=_0xfb93[_0x4880fc];return _0x22d8e8;};'use strict';var EventEmitter=require(_0x3fb9('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x3fb9('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3fb9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3fb9('0x3'),'afterDestroy':_0x3fb9('0x4')};function emitEvent(_0x518d74){return function(_0x4d262b,_0x43b635,_0x543591){ChatQueueEvents[_0x3fb9('0x5')](_0x518d74+':'+_0x4d262b['id'],_0x4d262b);ChatQueueEvents[_0x3fb9('0x5')](_0x518d74,_0x4d262b);_0x543591(null);};}for(var e in events){if(events[_0x3fb9('0x6')](e)){var event=events[e];ChatQueue[_0x3fb9('0x7')](e,emitEvent(event));}}module[_0x3fb9('0x8')]=ChatQueueEvents;