Built motion from commit 5b761a7b.|2.5.36
[motion2.git] / server / api / chatQueue / chatQueue.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 _0xb19f=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','save'];(function(_0x16083b,_0x21dfb4){var _0x582fc2=function(_0x5854d4){while(--_0x5854d4){_0x16083b['push'](_0x16083b['shift']());}};_0x582fc2(++_0x21dfb4);}(_0xb19f,0x7d));var _0xfb19=function(_0x12ef39,_0x18d320){_0x12ef39=_0x12ef39-0x0;var _0x47a734=_0xb19f[_0x12ef39];return _0x47a734;};'use strict';var EventEmitter=require(_0xfb19('0x0'));var ChatQueue=require(_0xfb19('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfb19('0x2'),'afterUpdate':_0xfb19('0x3'),'afterDestroy':_0xfb19('0x4')};function emitEvent(_0x4ca48b){return function(_0xe1c6f9,_0x585ed2,_0x520a16){ChatQueueEvents['emit'](_0x4ca48b+':'+_0xe1c6f9['id'],_0xe1c6f9);ChatQueueEvents[_0xfb19('0x5')](_0x4ca48b,_0xe1c6f9);_0x520a16(null);};}for(var e in events){if(events[_0xfb19('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xfb19('0x7')]=ChatQueueEvents;