Built motion from commit 47436d59.|2.6.7
[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 _0xa711=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb'];(function(_0x4f4f93,_0x8636da){var _0x56211a=function(_0x36af5a){while(--_0x36af5a){_0x4f4f93['push'](_0x4f4f93['shift']());}};_0x56211a(++_0x8636da);}(_0xa711,0x6e));var _0x1a71=function(_0xa2c084,_0x4ede18){_0xa2c084=_0xa2c084-0x0;var _0x38df1c=_0xa711[_0xa2c084];return _0x38df1c;};'use strict';var EventEmitter=require(_0x1a71('0x0'));var ChatQueue=require(_0x1a71('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x1a71('0x2')](0x0);var events={'afterCreate':_0x1a71('0x3'),'afterUpdate':_0x1a71('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1f7064){return function(_0x33d252,_0x39cacf,_0x3b8fe6){ChatQueueEvents['emit'](_0x1f7064+':'+_0x33d252['id'],_0x33d252);ChatQueueEvents[_0x1a71('0x5')](_0x1f7064,_0x33d252);_0x3b8fe6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1a71('0x6')](e,emitEvent(event));}}module[_0x1a71('0x7')]=ChatQueueEvents;