Built motion from commit 753c950e.|2.5.42
[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 _0x5883=['emit','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x58eeff,_0x16ad09){var _0x2828cc=function(_0x1c4f8e){while(--_0x1c4f8e){_0x58eeff['push'](_0x58eeff['shift']());}};_0x2828cc(++_0x16ad09);}(_0x5883,0x19e));var _0x3588=function(_0x597ade,_0x430820){_0x597ade=_0x597ade-0x0;var _0x1aeac6=_0x5883[_0x597ade];return _0x1aeac6;};'use strict';var EventEmitter=require(_0x3588('0x0'));var VoiceQueue=require(_0x3588('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3588('0x2')](0x0);var events={'afterCreate':_0x3588('0x3'),'afterUpdate':_0x3588('0x4'),'afterDestroy':_0x3588('0x5')};function emitEvent(_0x4c490b){return function(_0x33670c,_0x38bb62,_0x4e65ac){VoiceQueueEvents['emit'](_0x4c490b+':'+_0x33670c['id'],_0x33670c);VoiceQueueEvents[_0x3588('0x6')](_0x4c490b,_0x33670c);_0x4e65ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;