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 _0x803f=['remove','emit','hasOwnProperty','exports','events','ChatQueue','setMaxListeners','update'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x803f,0x64));var _0xf803=function(_0x480cd0,_0x1b19c0){_0x480cd0=_0x480cd0-0x0;var _0x9fef14=_0x803f[_0x480cd0];return _0x9fef14;};'use strict';var EventEmitter=require(_0xf803('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xf803('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf803('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf803('0x3'),'afterDestroy':_0xf803('0x4')};function emitEvent(_0x19ff73){return function(_0x6baafe,_0x5c2cd6,_0x57c4f0){ChatQueueEvents[_0xf803('0x5')](_0x19ff73+':'+_0x6baafe['id'],_0x6baafe);ChatQueueEvents[_0xf803('0x5')](_0x19ff73,_0x6baafe);_0x57c4f0(null);};}for(var e in events){if(events[_0xf803('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf803('0x7')]=ChatQueueEvents;