Built motion from commit 47436d59.|2.6.7
[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 _0x760f=['hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit'];(function(_0x4e504f,_0x2db9dd){var _0x3449c6=function(_0x3ed24f){while(--_0x3ed24f){_0x4e504f['push'](_0x4e504f['shift']());}};_0x3449c6(++_0x2db9dd);}(_0x760f,0xc9));var _0xf760=function(_0x2a2d92,_0xbe5728){_0x2a2d92=_0x2a2d92-0x0;var _0x5170c0=_0x760f[_0x2a2d92];return _0x5170c0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xf760('0x0'))['db'][_0xf760('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf760('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf760('0x3'),'afterDestroy':_0xf760('0x4')};function emitEvent(_0x2da43b){return function(_0x41e8d5,_0xbb3725,_0x39c897){VoiceQueueEvents[_0xf760('0x5')](_0x2da43b+':'+_0x41e8d5['id'],_0x41e8d5);VoiceQueueEvents[_0xf760('0x5')](_0x2da43b,_0x41e8d5);_0x39c897(null);};}for(var e in events){if(events[_0xf760('0x6')](e)){var event=events[e];VoiceQueue[_0xf760('0x7')](e,emitEvent(event));}}module[_0xf760('0x8')]=VoiceQueueEvents;