Built motion from commit fe909640.|2.6.8
[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 _0xa0f4=['events','ChatQueue','save','update','remove','emit','hook'];(function(_0x179d4d,_0x490f59){var _0x8abf9a=function(_0x426e90){while(--_0x426e90){_0x179d4d['push'](_0x179d4d['shift']());}};_0x8abf9a(++_0x490f59);}(_0xa0f4,0x11f));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4a0f('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x4a0f('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4a0f('0x2'),'afterUpdate':_0x4a0f('0x3'),'afterDestroy':_0x4a0f('0x4')};function emitEvent(_0x34d9d0){return function(_0x556081,_0x46c1fe,_0x4c90cb){ChatQueueEvents[_0x4a0f('0x5')](_0x34d9d0+':'+_0x556081['id'],_0x556081);ChatQueueEvents[_0x4a0f('0x5')](_0x34d9d0,_0x556081);_0x4c90cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4a0f('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;