Built motion from commit (unavailable).|2.5.11
[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 _0x321c=['emit','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update'];(function(_0x297cf3,_0x26abfa){var _0x31935a=function(_0x26e727){while(--_0x26e727){_0x297cf3['push'](_0x297cf3['shift']());}};_0x31935a(++_0x26abfa);}(_0x321c,0x84));var _0xc321=function(_0x3dbac1,_0xfd99f4){_0x3dbac1=_0x3dbac1-0x0;var _0x2bdce1=_0x321c[_0x3dbac1];return _0x2bdce1;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xc321('0x0'))['db'][_0xc321('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc321('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc321('0x3'),'afterDestroy':'remove'};function emitEvent(_0xb4a404){return function(_0x1022e9,_0x1720f8,_0x536a0a){VoiceQueueEvents[_0xc321('0x4')](_0xb4a404+':'+_0x1022e9['id'],_0x1022e9);VoiceQueueEvents[_0xc321('0x4')](_0xb4a404,_0x1022e9);_0x536a0a(null);};}for(var e in events){if(events[_0xc321('0x5')](e)){var event=events[e];VoiceQueue[_0xc321('0x6')](e,emitEvent(event));}}module[_0xc321('0x7')]=VoiceQueueEvents;