Built motion from commit b5413ace.|2.6.9
[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 _0xe35e=['../../mysqldb','ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0xec01b3,_0x55684e){var _0xe752f8=function(_0x522a9){while(--_0x522a9){_0xec01b3['push'](_0xec01b3['shift']());}};_0xe752f8(++_0x55684e);}(_0xe35e,0xfc));var _0xee35=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xe35e[_0x59c301];return _0x3866b9;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0xee35('0x0'))['db'][_0xee35('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xee35('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2bce91){return function(_0x4ac77f,_0x5f4caf,_0x1831e8){ChatQueueEvents[_0xee35('0x3')](_0x2bce91+':'+_0x4ac77f['id'],_0x4ac77f);ChatQueueEvents['emit'](_0x2bce91,_0x4ac77f);_0x1831e8(null);};}for(var e in events){if(events[_0xee35('0x4')](e)){var event=events[e];ChatQueue[_0xee35('0x5')](e,emitEvent(event));}}module[_0xee35('0x6')]=ChatQueueEvents;