Built motion from commit 7ab0e143.|2.5.49
[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 _0x13bb=['exports','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57d04b,_0x1a3a7f){var _0x1fd532=function(_0x5edce5){while(--_0x5edce5){_0x57d04b['push'](_0x57d04b['shift']());}};_0x1fd532(++_0x1a3a7f);}(_0x13bb,0x19b));var _0xb13b=function(_0x18be78,_0x35df9c){_0x18be78=_0x18be78-0x0;var _0xc3d9f2=_0x13bb[_0x18be78];return _0xc3d9f2;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xb13b('0x0'))['db'][_0xb13b('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb13b('0x2')](0x0);var events={'afterCreate':_0xb13b('0x3'),'afterUpdate':_0xb13b('0x4'),'afterDestroy':_0xb13b('0x5')};function emitEvent(_0x11c033){return function(_0x510993,_0x5bcf95,_0x4eee71){ChatQueueEvents[_0xb13b('0x6')](_0x11c033+':'+_0x510993['id'],_0x510993);ChatQueueEvents['emit'](_0x11c033,_0x510993);_0x4eee71(null);};}for(var e in events){if(events[_0xb13b('0x7')](e)){var event=events[e];ChatQueue[_0xb13b('0x8')](e,emitEvent(event));}}module[_0xb13b('0x9')]=ChatQueueEvents;