Built motion from commit 67e5df37.|2.0.66
[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 _0x930e=['update','emit','hasOwnProperty','hook','exports','events','VoiceQueue','save'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x930e,0x185));var _0xe930=function(_0x434281,_0x29a7ee){_0x434281=_0x434281-0x0;var _0x19e481=_0x930e[_0x434281];return _0x19e481;};'use strict';var EventEmitter=require(_0xe930('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xe930('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe930('0x2'),'afterUpdate':_0xe930('0x3'),'afterDestroy':'remove'};function emitEvent(_0x385e95){return function(_0x2f7a50,_0x20221e,_0x22acda){VoiceQueueEvents['emit'](_0x385e95+':'+_0x2f7a50['id'],_0x2f7a50);VoiceQueueEvents[_0xe930('0x4')](_0x385e95,_0x2f7a50);_0x22acda(null);};}for(var e in events){if(events[_0xe930('0x5')](e)){var event=events[e];VoiceQueue[_0xe930('0x6')](e,emitEvent(event));}}module[_0xe930('0x7')]=VoiceQueueEvents;