Built motion from commit 497d3d92.|2.5.43
[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 _0x832e=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x3a39f8,_0x297dfa){var _0x3de588=function(_0x31a9c3){while(--_0x31a9c3){_0x3a39f8['push'](_0x3a39f8['shift']());}};_0x3de588(++_0x297dfa);}(_0x832e,0x149));var _0xe832=function(_0x3d485e,_0x12e57){_0x3d485e=_0x3d485e-0x0;var _0x2411b7=_0x832e[_0x3d485e];return _0x2411b7;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xe832('0x0'))['db'][_0xe832('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xe832('0x2')](0x0);var events={'afterCreate':_0xe832('0x3'),'afterUpdate':'update','afterDestroy':_0xe832('0x4')};function emitEvent(_0x55cf25){return function(_0x18e4e0,_0x37caa7,_0x1a08d0){ChatQueueEvents[_0xe832('0x5')](_0x55cf25+':'+_0x18e4e0['id'],_0x18e4e0);ChatQueueEvents[_0xe832('0x5')](_0x55cf25,_0x18e4e0);_0x1a08d0(null);};}for(var e in events){if(events[_0xe832('0x6')](e)){var event=events[e];ChatQueue[_0xe832('0x7')](e,emitEvent(event));}}module[_0xe832('0x8')]=ChatQueueEvents;