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 _0xf781=['exports','OpenchannelQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0xf781,0x99));var _0x1f78=function(_0x2015aa,_0x436013){_0x2015aa=_0x2015aa-0x0;var _0x16ec07=_0xf781[_0x2015aa];return _0x16ec07;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x1f78('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x1f78('0x1')](0x0);var events={'afterCreate':_0x1f78('0x2'),'afterUpdate':_0x1f78('0x3'),'afterDestroy':'remove'};function emitEvent(_0x350611){return function(_0x40a40e,_0x446d51,_0x2eec1a){OpenchannelQueueEvents[_0x1f78('0x4')](_0x350611+':'+_0x40a40e['id'],_0x40a40e);OpenchannelQueueEvents[_0x1f78('0x4')](_0x350611,_0x40a40e);_0x2eec1a(null);};}for(var e in events){if(events[_0x1f78('0x5')](e)){var event=events[e];OpenchannelQueue[_0x1f78('0x6')](e,emitEvent(event));}}module[_0x1f78('0x7')]=OpenchannelQueueEvents;