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 _0x3fec=['hook','exports','events','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x493df0,_0x3808fe){var _0x4b6a03=function(_0x4a4228){while(--_0x4a4228){_0x493df0['push'](_0x493df0['shift']());}};_0x4b6a03(++_0x3808fe);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xc3fe('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xc3fe('0x1')](0x0);var events={'afterCreate':_0xc3fe('0x2'),'afterUpdate':'update','afterDestroy':_0xc3fe('0x3')};function emitEvent(_0x4f85a4){return function(_0x53a208,_0x1cdef8,_0x4d6191){ChatQueueEvents[_0xc3fe('0x4')](_0x4f85a4+':'+_0x53a208['id'],_0x53a208);ChatQueueEvents[_0xc3fe('0x4')](_0x4f85a4,_0x53a208);_0x4d6191(null);};}for(var e in events){if(events[_0xc3fe('0x5')](e)){var event=events[e];ChatQueue[_0xc3fe('0x6')](e,emitEvent(event));}}module[_0xc3fe('0x7')]=ChatQueueEvents;