Built motion from commit 3c2ce842.|2.6.31
[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 _0x1c08=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hook'];(function(_0x26f333,_0x394579){var _0x1424bb=function(_0x478063){while(--_0x478063){_0x26f333['push'](_0x26f333['shift']());}};_0x1424bb(++_0x394579);}(_0x1c08,0x17b));var _0x81c0=function(_0x39dbcb,_0x4f63d7){_0x39dbcb=_0x39dbcb-0x0;var _0x5aadb2=_0x1c08[_0x39dbcb];return _0x5aadb2;};'use strict';var EventEmitter=require(_0x81c0('0x0'));var ChatQueue=require(_0x81c0('0x1'))['db'][_0x81c0('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x81c0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x81c0('0x4'),'afterDestroy':_0x81c0('0x5')};function emitEvent(_0x5981ec){return function(_0x3f411d,_0x2d66e8,_0x1f8333){ChatQueueEvents[_0x81c0('0x6')](_0x5981ec+':'+_0x3f411d['id'],_0x3f411d);ChatQueueEvents[_0x81c0('0x6')](_0x5981ec,_0x3f411d);_0x1f8333(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x81c0('0x7')](e,emitEvent(event));}}module[_0x81c0('0x8')]=ChatQueueEvents;