Built motion from commit ab870f9e.|2.5.44
[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 _0xc50f=['emit','hasOwnProperty','hook','exports','events','VoiceQueue','save','update','remove'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xc50f,0x112));var _0xfc50=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xc50f[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xfc50('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xfc50('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc50('0x2'),'afterUpdate':_0xfc50('0x3'),'afterDestroy':_0xfc50('0x4')};function emitEvent(_0x4cb93a){return function(_0x50ab24,_0x12ed1c,_0x102219){VoiceQueueEvents[_0xfc50('0x5')](_0x4cb93a+':'+_0x50ab24['id'],_0x50ab24);VoiceQueueEvents[_0xfc50('0x5')](_0x4cb93a,_0x50ab24);_0x102219(null);};}for(var e in events){if(events[_0xfc50('0x6')](e)){var event=events[e];VoiceQueue[_0xfc50('0x7')](e,emitEvent(event));}}module[_0xfc50('0x8')]=VoiceQueueEvents;