8b32f744e9af00aaace25d7cc7208fe38de7826e
[motion2.git] / server / api / userVoiceQueueRt / userVoiceQueueRt.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 _0xaf99=['update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x5ea825,_0x2cb2bb){var _0x180af3=function(_0x5632b7){while(--_0x5632b7){_0x5ea825['push'](_0x5ea825['shift']());}};_0x180af3(++_0x2cb2bb);}(_0xaf99,0x95));var _0x9af9=function(_0x13ea77,_0x395d11){_0x13ea77=_0x13ea77-0x0;var _0x15298c=_0xaf99[_0x13ea77];return _0x15298c;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x9af9('0x0'))['db'][_0x9af9('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9af9('0x2')](0x0);var events={'afterCreate':_0x9af9('0x3'),'afterUpdate':_0x9af9('0x4'),'afterDestroy':_0x9af9('0x5')};function emitEvent(_0x22269d){return function(_0xef370d,_0x50135b,_0x22db3f){UserVoiceQueueRtEvents[_0x9af9('0x6')](_0x22269d+':'+_0xef370d['id'],_0xef370d);UserVoiceQueueRtEvents[_0x9af9('0x6')](_0x22269d,_0xef370d);_0x22db3f(null);};}for(var e in events){if(events[_0x9af9('0x7')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x9af9('0x8')]=UserVoiceQueueRtEvents;