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 _0xfa71=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfa71,0xa2));var _0x1fa7=function(_0x176c52,_0x4963f7){_0x176c52=_0x176c52-0x0;var _0x10af34=_0xfa71[_0x176c52];return _0x10af34;};'use strict';var EventEmitter=require(_0x1fa7('0x0'));var ChatQueue=require(_0x1fa7('0x1'))['db'][_0x1fa7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1fa7('0x3')](0x0);var events={'afterCreate':_0x1fa7('0x4'),'afterUpdate':_0x1fa7('0x5'),'afterDestroy':_0x1fa7('0x6')};function emitEvent(_0x5290c1){return function(_0x2ae3db,_0x2f4829,_0x5e5605){ChatQueueEvents[_0x1fa7('0x7')](_0x5290c1+':'+_0x2ae3db['id'],_0x2ae3db);ChatQueueEvents[_0x1fa7('0x7')](_0x5290c1,_0x2ae3db);_0x5e5605(null);};}for(var e in events){if(events[_0x1fa7('0x8')](e)){var event=events[e];ChatQueue[_0x1fa7('0x9')](e,emitEvent(event));}}module[_0x1fa7('0xa')]=ChatQueueEvents;