Built motion from commit d1eab355.|2.6.28
[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 _0x92a0=['hook','exports','events','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0x92a0,0x8e));var _0x092a=function(_0xc55c68,_0x292a8b){_0xc55c68=_0xc55c68-0x0;var _0x148523=_0x92a0[_0xc55c68];return _0x148523;};'use strict';var EventEmitter=require(_0x092a('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x092a('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x092a('0x2')](0x0);var events={'afterCreate':_0x092a('0x3'),'afterUpdate':_0x092a('0x4'),'afterDestroy':_0x092a('0x5')};function emitEvent(_0x56db7b){return function(_0xae667b,_0x12ecff,_0x14f1c2){VoiceQueueEvents[_0x092a('0x6')](_0x56db7b+':'+_0xae667b['id'],_0xae667b);VoiceQueueEvents[_0x092a('0x6')](_0x56db7b,_0xae667b);_0x14f1c2(null);};}for(var e in events){if(events[_0x092a('0x7')](e)){var event=events[e];VoiceQueue[_0x092a('0x8')](e,emitEvent(event));}}module[_0x092a('0x9')]=VoiceQueueEvents;