Built motion from commit 14588770.|2.5.38
[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 _0x905b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x905b,0x12e));var _0xb905=function(_0x52c583,_0x595d8b){_0x52c583=_0x52c583-0x0;var _0x53d77=_0x905b[_0x52c583];return _0x53d77;};'use strict';var EventEmitter=require(_0xb905('0x0'));var VoiceQueue=require(_0xb905('0x1'))['db'][_0xb905('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb905('0x3')](0x0);var events={'afterCreate':_0xb905('0x4'),'afterUpdate':_0xb905('0x5'),'afterDestroy':_0xb905('0x6')};function emitEvent(_0x38d6bb){return function(_0x9931b9,_0x2ae861,_0x27161e){VoiceQueueEvents[_0xb905('0x7')](_0x38d6bb+':'+_0x9931b9['id'],_0x9931b9);VoiceQueueEvents[_0xb905('0x7')](_0x38d6bb,_0x9931b9);_0x27161e(null);};}for(var e in events){if(events[_0xb905('0x8')](e)){var event=events[e];VoiceQueue[_0xb905('0x9')](e,emitEvent(event));}}module[_0xb905('0xa')]=VoiceQueueEvents;