Built motion from commit 00bf23f6.|2.6.16
[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 _0x3e6d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3e6d,0x15b));var _0xd3e6=function(_0x32e73c,_0x24c424){_0x32e73c=_0x32e73c-0x0;var _0x215cda=_0x3e6d[_0x32e73c];return _0x215cda;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xd3e6('0x0'))['db'][_0xd3e6('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd3e6('0x2')](0x0);var events={'afterCreate':_0xd3e6('0x3'),'afterUpdate':'update','afterDestroy':_0xd3e6('0x4')};function emitEvent(_0x21d633){return function(_0x3441b2,_0x15898e,_0x1768df){ChatQueueEvents[_0xd3e6('0x5')](_0x21d633+':'+_0x3441b2['id'],_0x3441b2);ChatQueueEvents[_0xd3e6('0x5')](_0x21d633,_0x3441b2);_0x1768df(null);};}for(var e in events){if(events[_0xd3e6('0x6')](e)){var event=events[e];ChatQueue[_0xd3e6('0x7')](e,emitEvent(event));}}module[_0xd3e6('0x8')]=ChatQueueEvents;