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 _0xc740=['emit','hook','ChatQueue','setMaxListeners','update','remove'];(function(_0x11946c,_0x12152c){var _0x383935=function(_0x61fce2){while(--_0x61fce2){_0x11946c['push'](_0x11946c['shift']());}};_0x383935(++_0x12152c);}(_0xc740,0x68));var _0x0c74=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xc740[_0x4154a6];return _0x3b2786;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x0c74('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0c74('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0c74('0x2'),'afterDestroy':_0x0c74('0x3')};function emitEvent(_0x225f66){return function(_0x47aa96,_0x237693,_0x59589b){ChatQueueEvents[_0x0c74('0x4')](_0x225f66+':'+_0x47aa96['id'],_0x47aa96);ChatQueueEvents[_0x0c74('0x4')](_0x225f66,_0x47aa96);_0x59589b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0c74('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;