Built motion from commit 10af8726.|2.6.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 _0x1d9d=['events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x470720,_0xa180a0){var _0x591c4c=function(_0x5e9d71){while(--_0x5e9d71){_0x470720['push'](_0x470720['shift']());}};_0x591c4c(++_0xa180a0);}(_0x1d9d,0x1a4));var _0xd1d9=function(_0x843188,_0x12d593){_0x843188=_0x843188-0x0;var _0x3ecef4=_0x1d9d[_0x843188];return _0x3ecef4;};'use strict';var EventEmitter=require(_0xd1d9('0x0'));var ChatQueue=require(_0xd1d9('0x1'))['db'][_0xd1d9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xd1d9('0x3')](0x0);var events={'afterCreate':_0xd1d9('0x4'),'afterUpdate':'update','afterDestroy':_0xd1d9('0x5')};function emitEvent(_0x167ef3){return function(_0x39ddc7,_0x4961e1,_0xb7e7d2){ChatQueueEvents[_0xd1d9('0x6')](_0x167ef3+':'+_0x39ddc7['id'],_0x39ddc7);ChatQueueEvents['emit'](_0x167ef3,_0x39ddc7);_0xb7e7d2(null);};}for(var e in events){if(events[_0xd1d9('0x7')](e)){var event=events[e];ChatQueue[_0xd1d9('0x8')](e,emitEvent(event));}}module[_0xd1d9('0x9')]=ChatQueueEvents;