Built motion from commit 9d7072cc.|2.5.39
[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 _0x252c=['save','update','remove','emit','hasOwnProperty','hook','exports','events','VoiceQueue','setMaxListeners'];(function(_0x4d3754,_0x403267){var _0xf50ec1=function(_0x4b9c43){while(--_0x4b9c43){_0x4d3754['push'](_0x4d3754['shift']());}};_0xf50ec1(++_0x403267);}(_0x252c,0xc5));var _0xc252=function(_0x325bc4,_0x4df462){_0x325bc4=_0x325bc4-0x0;var _0x330091=_0x252c[_0x325bc4];return _0x330091;};'use strict';var EventEmitter=require(_0xc252('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xc252('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc252('0x2')](0x0);var events={'afterCreate':_0xc252('0x3'),'afterUpdate':_0xc252('0x4'),'afterDestroy':_0xc252('0x5')};function emitEvent(_0x5d2674){return function(_0x153cc0,_0xcff816,_0x1227f4){VoiceQueueEvents['emit'](_0x5d2674+':'+_0x153cc0['id'],_0x153cc0);VoiceQueueEvents[_0xc252('0x6')](_0x5d2674,_0x153cc0);_0x1227f4(null);};}for(var e in events){if(events[_0xc252('0x7')](e)){var event=events[e];VoiceQueue[_0xc252('0x8')](e,emitEvent(event));}}module[_0xc252('0x9')]=VoiceQueueEvents;