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 _0xb467=['save','remove','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x41730d,_0xe768e0){var _0x381584=function(_0x90f4d8){while(--_0x90f4d8){_0x41730d['push'](_0x41730d['shift']());}};_0x381584(++_0xe768e0);}(_0xb467,0x111));var _0x7b46=function(_0xa28b1a,_0x384f4b){_0xa28b1a=_0xa28b1a-0x0;var _0x4c9b78=_0xb467[_0xa28b1a];return _0x4c9b78;};'use strict';var EventEmitter=require(_0x7b46('0x0'));var ChatQueue=require(_0x7b46('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7b46('0x2')](0x0);var events={'afterCreate':_0x7b46('0x3'),'afterUpdate':'update','afterDestroy':_0x7b46('0x4')};function emitEvent(_0x3e7a86){return function(_0x5065a3,_0x1b531b,_0x19812f){ChatQueueEvents['emit'](_0x3e7a86+':'+_0x5065a3['id'],_0x5065a3);ChatQueueEvents['emit'](_0x3e7a86,_0x5065a3);_0x19812f(null);};}for(var e in events){if(events[_0x7b46('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;