Built motion from commit da617fac.|2.6.6
[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 _0x1be2=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x24887c,_0x590c42){var _0x47ccce=function(_0x4f09ff){while(--_0x4f09ff){_0x24887c['push'](_0x24887c['shift']());}};_0x47ccce(++_0x590c42);}(_0x1be2,0x181));var _0x21be=function(_0x171f39,_0x409908){_0x171f39=_0x171f39-0x0;var _0x5ac531=_0x1be2[_0x171f39];return _0x5ac531;};'use strict';var EventEmitter=require(_0x21be('0x0'));var ChatQueue=require(_0x21be('0x1'))['db'][_0x21be('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x21be('0x3')](0x0);var events={'afterCreate':_0x21be('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4a2500){return function(_0x5bec9a,_0x55e8e4,_0x318576){ChatQueueEvents[_0x21be('0x5')](_0x4a2500+':'+_0x5bec9a['id'],_0x5bec9a);ChatQueueEvents[_0x21be('0x5')](_0x4a2500,_0x5bec9a);_0x318576(null);};}for(var e in events){if(events[_0x21be('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x21be('0x7')]=ChatQueueEvents;