Built motion from commit 1fa89557.|2.6.10
[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 _0xa37a=['ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x33e5bb,_0x301be8){var _0x2810a6=function(_0x3330c4){while(--_0x3330c4){_0x33e5bb['push'](_0x33e5bb['shift']());}};_0x2810a6(++_0x301be8);}(_0xa37a,0x103));var _0xaa37=function(_0x2cf3d0,_0x38b8c8){_0x2cf3d0=_0x2cf3d0-0x0;var _0x2c98b1=_0xa37a[_0x2cf3d0];return _0x2c98b1;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xaa37('0x0'))['db'][_0xaa37('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaa37('0x2')](0x0);var events={'afterCreate':_0xaa37('0x3'),'afterUpdate':_0xaa37('0x4'),'afterDestroy':_0xaa37('0x5')};function emitEvent(_0x1173e4){return function(_0x5f00f8,_0x64b2e1,_0x2c5b1c){ChatQueueEvents[_0xaa37('0x6')](_0x1173e4+':'+_0x5f00f8['id'],_0x5f00f8);ChatQueueEvents[_0xaa37('0x6')](_0x1173e4,_0x5f00f8);_0x2c5b1c(null);};}for(var e in events){if(events[_0xaa37('0x7')](e)){var event=events[e];ChatQueue[_0xaa37('0x8')](e,emitEvent(event));}}module[_0xaa37('0x9')]=ChatQueueEvents;