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 _0x1cd5=['hasOwnProperty','hook','exports','events','setMaxListeners','update','remove','emit'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x1cd5,0x193));var _0x51cd=function(_0x42331d,_0x324fe0){_0x42331d=_0x42331d-0x0;var _0x4b0c71=_0x1cd5[_0x42331d];return _0x4b0c71;};'use strict';var EventEmitter=require(_0x51cd('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x51cd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x51cd('0x2'),'afterDestroy':_0x51cd('0x3')};function emitEvent(_0x2fdfa5){return function(_0x19c74f,_0x538b10,_0x2bd804){ChatQueueEvents[_0x51cd('0x4')](_0x2fdfa5+':'+_0x19c74f['id'],_0x19c74f);ChatQueueEvents[_0x51cd('0x4')](_0x2fdfa5,_0x19c74f);_0x2bd804(null);};}for(var e in events){if(events[_0x51cd('0x5')](e)){var event=events[e];ChatQueue[_0x51cd('0x6')](e,emitEvent(event));}}module[_0x51cd('0x7')]=ChatQueueEvents;