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 _0xf9b4=['emit','hook','events','setMaxListeners','save','update','remove'];(function(_0x5df061,_0x400a05){var _0x5a4ef6=function(_0x224a94){while(--_0x224a94){_0x5df061['push'](_0x5df061['shift']());}};_0x5a4ef6(++_0x400a05);}(_0xf9b4,0x64));var _0x4f9b=function(_0xf61129,_0x523668){_0xf61129=_0xf61129-0x0;var _0xefa38a=_0xf9b4[_0xf61129];return _0xefa38a;};'use strict';var EventEmitter=require(_0x4f9b('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4f9b('0x1')](0x0);var events={'afterCreate':_0x4f9b('0x2'),'afterUpdate':_0x4f9b('0x3'),'afterDestroy':_0x4f9b('0x4')};function emitEvent(_0x561d1e){return function(_0x3e68ce,_0x1655ba,_0x3f37cb){ChatQueueEvents[_0x4f9b('0x5')](_0x561d1e+':'+_0x3e68ce['id'],_0x3e68ce);ChatQueueEvents[_0x4f9b('0x5')](_0x561d1e,_0x3e68ce);_0x3f37cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4f9b('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;