Built motion from commit da24aabd.|2.6.20
[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 _0x4814=['hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x13a69e,_0x7d914e){var _0x51d513=function(_0x6f9b91){while(--_0x6f9b91){_0x13a69e['push'](_0x13a69e['shift']());}};_0x51d513(++_0x7d914e);}(_0x4814,0xde));var _0x4481=function(_0x5dc0b3,_0xb624a6){_0x5dc0b3=_0x5dc0b3-0x0;var _0x3ec2ed=_0x4814[_0x5dc0b3];return _0x3ec2ed;};'use strict';var EventEmitter=require(_0x4481('0x0'));var ChatQueue=require(_0x4481('0x1'))['db'][_0x4481('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4481('0x3'),'afterUpdate':_0x4481('0x4'),'afterDestroy':_0x4481('0x5')};function emitEvent(_0x244e9e){return function(_0x5cf522,_0x5196fa,_0x257112){ChatQueueEvents[_0x4481('0x6')](_0x244e9e+':'+_0x5cf522['id'],_0x5cf522);ChatQueueEvents['emit'](_0x244e9e,_0x5cf522);_0x257112(null);};}for(var e in events){if(events[_0x4481('0x7')](e)){var event=events[e];ChatQueue[_0x4481('0x8')](e,emitEvent(event));}}module[_0x4481('0x9')]=ChatQueueEvents;