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 _0x6108=['ChatQueue','setMaxListeners','save','emit','hasOwnProperty','hook','events'];(function(_0x4b0733,_0x2324ed){var _0x1d5fdc=function(_0x2fb672){while(--_0x2fb672){_0x4b0733['push'](_0x4b0733['shift']());}};_0x1d5fdc(++_0x2324ed);}(_0x6108,0xbc));var _0x8610=function(_0x3fc430,_0x17dcdf){_0x3fc430=_0x3fc430-0x0;var _0x59a28d=_0x6108[_0x3fc430];return _0x59a28d;};'use strict';var EventEmitter=require(_0x8610('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x8610('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8610('0x2')](0x0);var events={'afterCreate':_0x8610('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x142cb5){return function(_0x42741d,_0x54802f,_0x4aa00f){ChatQueueEvents[_0x8610('0x4')](_0x142cb5+':'+_0x42741d['id'],_0x42741d);ChatQueueEvents[_0x8610('0x4')](_0x142cb5,_0x42741d);_0x4aa00f(null);};}for(var e in events){if(events[_0x8610('0x5')](e)){var event=events[e];ChatQueue[_0x8610('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;