Built motion from commit bab6f49e.|2.6.17
[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 _0xc21d=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','hasOwnProperty','hook','exports','events'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xc21d,0xc5));var _0xdc21=function(_0x4b8541,_0x509478){_0x4b8541=_0x4b8541-0x0;var _0x51f9c9=_0xc21d[_0x4b8541];return _0x51f9c9;};'use strict';var EventEmitter=require(_0xdc21('0x0'));var VoiceQueue=require(_0xdc21('0x1'))['db'][_0xdc21('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xdc21('0x3')](0x0);var events={'afterCreate':_0xdc21('0x4'),'afterUpdate':_0xdc21('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2c30a3){return function(_0x72ec5a,_0x30b3e4,_0x3a9574){VoiceQueueEvents['emit'](_0x2c30a3+':'+_0x72ec5a['id'],_0x72ec5a);VoiceQueueEvents['emit'](_0x2c30a3,_0x72ec5a);_0x3a9574(null);};}for(var e in events){if(events[_0xdc21('0x6')](e)){var event=events[e];VoiceQueue[_0xdc21('0x7')](e,emitEvent(event));}}module[_0xdc21('0x8')]=VoiceQueueEvents;