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 _0xd8b5=['emit','events','ChatQueue','setMaxListeners','save'];(function(_0x175662,_0x50a6e9){var _0x2270f7=function(_0x532064){while(--_0x532064){_0x175662['push'](_0x175662['shift']());}};_0x2270f7(++_0x50a6e9);}(_0xd8b5,0x141));var _0x5d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b5[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5d8b('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x5d8b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5d8b('0x2')](0x0);var events={'afterCreate':_0x5d8b('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29d782){return function(_0xc3a97d,_0x119ceb,_0x1de3a6){ChatQueueEvents['emit'](_0x29d782+':'+_0xc3a97d['id'],_0xc3a97d);ChatQueueEvents[_0x5d8b('0x4')](_0x29d782,_0xc3a97d);_0x1de3a6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents;