Built motion from commit ffdca78c.|2.6.24
[motion2.git] / server / api / voiceQueue / voiceQueue.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x1efc=['setMaxListeners','save','remove','emit','exports','events'];(function(_0x168600,_0x592ff9){var _0x36d379=function(_0x44ca91){while(--_0x44ca91){_0x168600['push'](_0x168600['shift']());}};_0x36d379(++_0x592ff9);}(_0x1efc,0x1b5));var _0xc1ef=function(_0x912d27,_0x28e0e3){_0x912d27=_0x912d27-0x0;var _0x31b918=_0x1efc[_0x912d27];return _0x31b918;};'use strict';var EventEmitter=require(_0xc1ef('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc1ef('0x1')](0x0);var events={'afterCreate':_0xc1ef('0x2'),'afterUpdate':'update','afterDestroy':_0xc1ef('0x3')};function emitEvent(_0x420ddc){return function(_0x3cceee,_0x2e9049,_0x35e749){VoiceQueueEvents[_0xc1ef('0x4')](_0x420ddc+':'+_0x3cceee['id'],_0x3cceee);VoiceQueueEvents['emit'](_0x420ddc,_0x3cceee);_0x35e749(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xc1ef('0x5')]=VoiceQueueEvents;