Built motion from commit bab6f49e.|2.6.17
[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 _0x28b2=['update','remove','emit','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x3aa11c,_0x1107e5){var _0x347577=function(_0x58c7da){while(--_0x58c7da){_0x3aa11c['push'](_0x3aa11c['shift']());}};_0x347577(++_0x1107e5);}(_0x28b2,0x16c));var _0x228b=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x28b2[_0x4f9b18];return _0x29f20c;};'use strict';var EventEmitter=require(_0x228b('0x0'));var UserVoiceQueueRt=require(_0x228b('0x1'))['db'][_0x228b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x228b('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x228b('0x4'),'afterDestroy':_0x228b('0x5')};function emitEvent(_0x13e177){return function(_0x4aa4cf,_0x5197a6,_0xd3ab21){UserVoiceQueueRtEvents['emit'](_0x13e177+':'+_0x4aa4cf['id'],_0x4aa4cf);UserVoiceQueueRtEvents[_0x228b('0x6')](_0x13e177,_0x4aa4cf);_0xd3ab21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x228b('0x7')]=UserVoiceQueueRtEvents;