Built motion from commit 936e8062.|2.5.33
[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 _0x1d25=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatQueue'];(function(_0x577ebb,_0x22d92a){var _0x16c69a=function(_0x105d3d){while(--_0x105d3d){_0x577ebb['push'](_0x577ebb['shift']());}};_0x16c69a(++_0x22d92a);}(_0x1d25,0xba));var _0x51d2=function(_0x5a7dd3,_0x26b7cf){_0x5a7dd3=_0x5a7dd3-0x0;var _0x2f4d07=_0x1d25[_0x5a7dd3];return _0x2f4d07;};'use strict';var EventEmitter=require(_0x51d2('0x0'));var ChatQueue=require(_0x51d2('0x1'))['db'][_0x51d2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x51d2('0x3')](0x0);var events={'afterCreate':_0x51d2('0x4'),'afterUpdate':'update','afterDestroy':_0x51d2('0x5')};function emitEvent(_0x3d53fe){return function(_0x4c93f2,_0x1f9fc8,_0x41df5e){ChatQueueEvents[_0x51d2('0x6')](_0x3d53fe+':'+_0x4c93f2['id'],_0x4c93f2);ChatQueueEvents[_0x51d2('0x6')](_0x3d53fe,_0x4c93f2);_0x41df5e(null);};}for(var e in events){if(events[_0x51d2('0x7')](e)){var event=events[e];ChatQueue[_0x51d2('0x8')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;