Built motion from commit da24aabd.|2.6.20
[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 _0x85ed=['exports','events','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3a5c68,_0x2e2c7b){var _0x127add=function(_0x3adedd){while(--_0x3adedd){_0x3a5c68['push'](_0x3a5c68['shift']());}};_0x127add(++_0x2e2c7b);}(_0x85ed,0xb9));var _0xd85e=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x85ed[_0x45783c];return _0x1161da;};'use strict';var EventEmitter=require(_0xd85e('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xd85e('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xd85e('0x2')](0x0);var events={'afterCreate':_0xd85e('0x3'),'afterUpdate':_0xd85e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1131a2){return function(_0x1d25d2,_0xc0e2e0,_0x438982){VoiceQueueEvents['emit'](_0x1131a2+':'+_0x1d25d2['id'],_0x1d25d2);VoiceQueueEvents[_0xd85e('0x5')](_0x1131a2,_0x1d25d2);_0x438982(null);};}for(var e in events){if(events[_0xd85e('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xd85e('0x7')]=VoiceQueueEvents;