Built motion from commit e0fa946e.|2.6.5
[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 _0x0ba9=['exports','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x14beba,_0xa2c951){var _0x3b97fe=function(_0x499a0d){while(--_0x499a0d){_0x14beba['push'](_0x14beba['shift']());}};_0x3b97fe(++_0xa2c951);}(_0x0ba9,0x1ba));var _0x90ba=function(_0x27e188,_0x11ba07){_0x27e188=_0x27e188-0x0;var _0x529031=_0x0ba9[_0x27e188];return _0x529031;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x90ba('0x0'))['db'][_0x90ba('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x90ba('0x2')](0x0);var events={'afterCreate':_0x90ba('0x3'),'afterUpdate':_0x90ba('0x4'),'afterDestroy':_0x90ba('0x5')};function emitEvent(_0x4c9189){return function(_0x2da177,_0x209716,_0x173ab7){VoiceQueueEvents['emit'](_0x4c9189+':'+_0x2da177['id'],_0x2da177);VoiceQueueEvents[_0x90ba('0x6')](_0x4c9189,_0x2da177);_0x173ab7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x90ba('0x7')](e,emitEvent(event));}}module[_0x90ba('0x8')]=VoiceQueueEvents;