Built motion from commit 19a84241.|2.5.34
[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 _0xbb04=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x208d39,_0x5de94f){var _0x3f96cb=function(_0x23d510){while(--_0x23d510){_0x208d39['push'](_0x208d39['shift']());}};_0x3f96cb(++_0x5de94f);}(_0xbb04,0x18f));var _0x4bb0=function(_0x23d2a0,_0x516174){_0x23d2a0=_0x23d2a0-0x0;var _0x409e80=_0xbb04[_0x23d2a0];return _0x409e80;};'use strict';var EventEmitter=require(_0x4bb0('0x0'));var ChatQueue=require(_0x4bb0('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4bb0('0x2')](0x0);var events={'afterCreate':_0x4bb0('0x3'),'afterUpdate':_0x4bb0('0x4'),'afterDestroy':_0x4bb0('0x5')};function emitEvent(_0x421449){return function(_0x296ff7,_0x55b18d,_0x33a56c){ChatQueueEvents[_0x4bb0('0x6')](_0x421449+':'+_0x296ff7['id'],_0x296ff7);ChatQueueEvents[_0x4bb0('0x6')](_0x421449,_0x296ff7);_0x33a56c(null);};}for(var e in events){if(events[_0x4bb0('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4bb0('0x8')]=ChatQueueEvents;