Built motion from commit f541bb3b.|2.6.14
[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 _0x4283=['setMaxListeners','save','remove','hasOwnProperty','hook','events'];(function(_0x14866a,_0x127ada){var _0x40b973=function(_0x34bad3){while(--_0x34bad3){_0x14866a['push'](_0x14866a['shift']());}};_0x40b973(++_0x127ada);}(_0x4283,0x119));var _0x3428=function(_0x16806e,_0x4d52c4){_0x16806e=_0x16806e-0x0;var _0x553909=_0x4283[_0x16806e];return _0x553909;};'use strict';var EventEmitter=require(_0x3428('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3428('0x1')](0x0);var events={'afterCreate':_0x3428('0x2'),'afterUpdate':'update','afterDestroy':_0x3428('0x3')};function emitEvent(_0x19fe15){return function(_0xa7f10e,_0x5eceda,_0x445574){ChatQueueEvents['emit'](_0x19fe15+':'+_0xa7f10e['id'],_0xa7f10e);ChatQueueEvents['emit'](_0x19fe15,_0xa7f10e);_0x445574(null);};}for(var e in events){if(events[_0x3428('0x4')](e)){var event=events[e];ChatQueue[_0x3428('0x5')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;