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 _0x685d=['emit','exports','events','OpenchannelQueue','update','remove'];(function(_0x472f68,_0x340b83){var _0x732e55=function(_0x43808b){while(--_0x43808b){_0x472f68['push'](_0x472f68['shift']());}};_0x732e55(++_0x340b83);}(_0x685d,0x1d6));var _0xd685=function(_0x5f0657,_0x48093b){_0x5f0657=_0x5f0657-0x0;var _0x1b1bd5=_0x685d[_0x5f0657];return _0x1b1bd5;};'use strict';var EventEmitter=require(_0xd685('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xd685('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd685('0x2'),'afterDestroy':_0xd685('0x3')};function emitEvent(_0x5f062a){return function(_0x518654,_0x4cad5e,_0xa37c2c){OpenchannelQueueEvents[_0xd685('0x4')](_0x5f062a+':'+_0x518654['id'],_0x518654);OpenchannelQueueEvents[_0xd685('0x4')](_0x5f062a,_0x518654);_0xa37c2c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xd685('0x5')]=OpenchannelQueueEvents;