Built motion from commit (unavailable).|2.5.10
[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 _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0xf62f27,_0x249f1d){var _0x4f7985=function(_0x54875b){while(--_0x54875b){_0xf62f27['push'](_0xf62f27['shift']());}};_0x4f7985(++_0x249f1d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents;