Built motion from commit da617fac.|2.6.6
[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 _0x75df=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatQueue','setMaxListeners','update','remove'];(function(_0x2ed95a,_0x334656){var _0x57cd63=function(_0x5d36d9){while(--_0x5d36d9){_0x2ed95a['push'](_0x2ed95a['shift']());}};_0x57cd63(++_0x334656);}(_0x75df,0x1e9));var _0xf75d=function(_0xf88ceb,_0x151528){_0xf88ceb=_0xf88ceb-0x0;var _0x217c3a=_0x75df[_0xf88ceb];return _0x217c3a;};'use strict';var EventEmitter=require(_0xf75d('0x0'));var ChatQueue=require(_0xf75d('0x1'))['db'][_0xf75d('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf75d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf75d('0x4'),'afterDestroy':_0xf75d('0x5')};function emitEvent(_0x397c53){return function(_0x359de0,_0x306aec,_0x4f8bcf){ChatQueueEvents[_0xf75d('0x6')](_0x397c53+':'+_0x359de0['id'],_0x359de0);ChatQueueEvents[_0xf75d('0x6')](_0x397c53,_0x359de0);_0x4f8bcf(null);};}for(var e in events){if(events[_0xf75d('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xf75d('0x8')]=ChatQueueEvents;