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 _0xd197=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x12a5ac,_0x4cb0d2){var _0x282958=function(_0x3ae041){while(--_0x3ae041){_0x12a5ac['push'](_0x12a5ac['shift']());}};_0x282958(++_0x4cb0d2);}(_0xd197,0x18b));var _0x7d19=function(_0x425c44,_0x5dcdf4){_0x425c44=_0x425c44-0x0;var _0x16aa55=_0xd197[_0x425c44];return _0x16aa55;};'use strict';var EventEmitter=require(_0x7d19('0x0'));var ChatQueue=require(_0x7d19('0x1'))['db'][_0x7d19('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7d19('0x3')](0x0);var events={'afterCreate':_0x7d19('0x4'),'afterUpdate':_0x7d19('0x5'),'afterDestroy':_0x7d19('0x6')};function emitEvent(_0x56bff2){return function(_0x3728b9,_0x437a8c,_0x1741c9){ChatQueueEvents[_0x7d19('0x7')](_0x56bff2+':'+_0x3728b9['id'],_0x3728b9);ChatQueueEvents[_0x7d19('0x7')](_0x56bff2,_0x3728b9);_0x1741c9(null);};}for(var e in events){if(events[_0x7d19('0x8')](e)){var event=events[e];ChatQueue[_0x7d19('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;