Built motion from commit ddca4d0d.|2.5.47
[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 _0x4704=['emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x4704,0xc9));var _0x4470=function(_0x4e291f,_0x202c9){_0x4e291f=_0x4e291f-0x0;var _0x3b2d52=_0x4704[_0x4e291f];return _0x3b2d52;};'use strict';var EventEmitter=require(_0x4470('0x0'));var ChatQueue=require(_0x4470('0x1'))['db'][_0x4470('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4470('0x3')](0x0);var events={'afterCreate':_0x4470('0x4'),'afterUpdate':'update','afterDestroy':_0x4470('0x5')};function emitEvent(_0xe4b529){return function(_0x2f0598,_0x3255fe,_0x380b08){ChatQueueEvents['emit'](_0xe4b529+':'+_0x2f0598['id'],_0x2f0598);ChatQueueEvents[_0x4470('0x6')](_0xe4b529,_0x2f0598);_0x380b08(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4470('0x7')](e,emitEvent(event));}}module[_0x4470('0x8')]=ChatQueueEvents;