Built motion from commit 9e1399f3.|2.5.37
[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 _0x03ae=['../../mysqldb','VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty','exports'];(function(_0x4a8721,_0x143f8c){var _0x4ba00f=function(_0x2655d9){while(--_0x2655d9){_0x4a8721['push'](_0x4a8721['shift']());}};_0x4ba00f(++_0x143f8c);}(_0x03ae,0xe0));var _0xe03a=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x03ae[_0x138adb];return _0x1b27f2;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xe03a('0x0'))['db'][_0xe03a('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xe03a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe03a('0x3')};function emitEvent(_0x1bcb0f){return function(_0x5ecdd1,_0x40aa44,_0x484ffd){VoiceQueueEvents[_0xe03a('0x4')](_0x1bcb0f+':'+_0x5ecdd1['id'],_0x5ecdd1);VoiceQueueEvents[_0xe03a('0x4')](_0x1bcb0f,_0x5ecdd1);_0x484ffd(null);};}for(var e in events){if(events[_0xe03a('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xe03a('0x6')]=VoiceQueueEvents;