Built motion from commit 0555bc41.|2.5.41
[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 _0x732a=['emit','hook','exports','events','VoiceQueue','setMaxListeners','update','remove'];(function(_0xe4b37a,_0x504920){var _0x1b7bd4=function(_0x33e8ec){while(--_0x33e8ec){_0xe4b37a['push'](_0xe4b37a['shift']());}};_0x1b7bd4(++_0x504920);}(_0x732a,0xab));var _0xa732=function(_0x272ed5,_0x174b1a){_0x272ed5=_0x272ed5-0x0;var _0x2e3657=_0x732a[_0x272ed5];return _0x2e3657;};'use strict';var EventEmitter=require(_0xa732('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xa732('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa732('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa732('0x3'),'afterDestroy':_0xa732('0x4')};function emitEvent(_0x171af5){return function(_0x2e7e91,_0x2c7d9f,_0x2642d5){VoiceQueueEvents[_0xa732('0x5')](_0x171af5+':'+_0x2e7e91['id'],_0x2e7e91);VoiceQueueEvents[_0xa732('0x5')](_0x171af5,_0x2e7e91);_0x2642d5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa732('0x6')](e,emitEvent(event));}}module[_0xa732('0x7')]=VoiceQueueEvents;