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 _0xe524=['../../mysqldb','ChatQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x23aadf,_0x34eba6){var _0x2f13fd=function(_0x2ee75b){while(--_0x2ee75b){_0x23aadf['push'](_0x23aadf['shift']());}};_0x2f13fd(++_0x34eba6);}(_0xe524,0x1d8));var _0x4e52=function(_0x5376f6,_0x12646a){_0x5376f6=_0x5376f6-0x0;var _0x4a0325=_0xe524[_0x5376f6];return _0x4a0325;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4e52('0x0'))['db'][_0x4e52('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4e52('0x2')](0x0);var events={'afterCreate':_0x4e52('0x3'),'afterUpdate':_0x4e52('0x4'),'afterDestroy':'remove'};function emitEvent(_0x23bee6){return function(_0xfb6ebb,_0x8c5913,_0x1d896d){ChatQueueEvents[_0x4e52('0x5')](_0x23bee6+':'+_0xfb6ebb['id'],_0xfb6ebb);ChatQueueEvents[_0x4e52('0x5')](_0x23bee6,_0xfb6ebb);_0x1d896d(null);};}for(var e in events){if(events[_0x4e52('0x6')](e)){var event=events[e];ChatQueue[_0x4e52('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;