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 _0xa3d4=['setMaxListeners','update','remove','emit','hook','exports','../../mysqldb','ChatQueue'];(function(_0x29bcd1,_0x321aab){var _0xe7f9cb=function(_0x250661){while(--_0x250661){_0x29bcd1['push'](_0x29bcd1['shift']());}};_0xe7f9cb(++_0x321aab);}(_0xa3d4,0x12e));var _0x4a3d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa3d4[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4a3d('0x0'))['db'][_0x4a3d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4a3d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a3d('0x3'),'afterDestroy':_0x4a3d('0x4')};function emitEvent(_0x2bc5d2){return function(_0x33ff2f,_0x335971,_0xaef77c){ChatQueueEvents[_0x4a3d('0x5')](_0x2bc5d2+':'+_0x33ff2f['id'],_0x33ff2f);ChatQueueEvents[_0x4a3d('0x5')](_0x2bc5d2,_0x33ff2f);_0xaef77c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4a3d('0x6')](e,emitEvent(event));}}module[_0x4a3d('0x7')]=ChatQueueEvents;