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 _0x219a=['ChatQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x219a,0x1c7));var _0xa219=function(_0x171b31,_0x55cc7c){_0x171b31=_0x171b31-0x0;var _0x5af5ba=_0x219a[_0x171b31];return _0x5af5ba;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xa219('0x0'))['db'][_0xa219('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa219('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa219('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4eae13){return function(_0x2a307c,_0x54e78b,_0x2deb1c){ChatQueueEvents['emit'](_0x4eae13+':'+_0x2a307c['id'],_0x2a307c);ChatQueueEvents[_0xa219('0x4')](_0x4eae13,_0x2a307c);_0x2deb1c(null);};}for(var e in events){if(events[_0xa219('0x5')](e)){var event=events[e];ChatQueue[_0xa219('0x6')](e,emitEvent(event));}}module[_0xa219('0x7')]=ChatQueueEvents;