Built motion from commit 953226e6.|2.6.32
[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 _0xf9f7=['exports','events','../../mysqldb','VoiceQueue','remove','emit','hasOwnProperty'];(function(_0x94d643,_0x4aacd4){var _0xdaf0dc=function(_0x12446f){while(--_0x12446f){_0x94d643['push'](_0x94d643['shift']());}};_0xdaf0dc(++_0x4aacd4);}(_0xf9f7,0xd3));var _0x7f9f=function(_0x5d19f8,_0x56a7bb){_0x5d19f8=_0x5d19f8-0x0;var _0x42e896=_0xf9f7[_0x5d19f8];return _0x42e896;};'use strict';var EventEmitter=require(_0x7f9f('0x0'));var VoiceQueue=require(_0x7f9f('0x1'))['db'][_0x7f9f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7f9f('0x3')};function emitEvent(_0x234531){return function(_0x1d5969,_0x1cedf9,_0x3e0504){VoiceQueueEvents[_0x7f9f('0x4')](_0x234531+':'+_0x1d5969['id'],_0x1d5969);VoiceQueueEvents[_0x7f9f('0x4')](_0x234531,_0x1d5969);_0x3e0504(null);};}for(var e in events){if(events[_0x7f9f('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x7f9f('0x6')]=VoiceQueueEvents;