e5cdd386a83bde47de827903624267d1eb2be637
[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 _0xff16=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x641ccb,_0x311d8c){var _0xeb5d0f=function(_0x3f9072){while(--_0x3f9072){_0x641ccb['push'](_0x641ccb['shift']());}};_0xeb5d0f(++_0x311d8c);}(_0xff16,0x7f));var _0x6ff1=function(_0x3b4f53,_0x57620c){_0x3b4f53=_0x3b4f53-0x0;var _0x258204=_0xff16[_0x3b4f53];return _0x258204;};'use strict';var EventEmitter=require(_0x6ff1('0x0'));var ChatQueue=require(_0x6ff1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6ff1('0x2')](0x0);var events={'afterCreate':_0x6ff1('0x3'),'afterUpdate':_0x6ff1('0x4'),'afterDestroy':_0x6ff1('0x5')};function emitEvent(_0x3f3c60){return function(_0x3f53b2,_0x3e4c94,_0x18be1c){ChatQueueEvents['emit'](_0x3f3c60+':'+_0x3f53b2['id'],_0x3f53b2);ChatQueueEvents[_0x6ff1('0x6')](_0x3f3c60,_0x3f53b2);_0x18be1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6ff1('0x7')](e,emitEvent(event));}}module[_0x6ff1('0x8')]=ChatQueueEvents;